private function buildBundleDefinition($classname, $bundleId, $baseDir)
    {
        if (false === is_subclass_of($classname, 'BackBee\Bundle\BundleInterface')) {
            throw new InvalidArgumentException(
                "Bundles must implement `BackBee\Bundle\BundleInterface`, `$classname` does not."
            );
        }

        $definition = new Definition($classname, array(new Reference('bbapp'), $bundleId, $baseDir));
        $definition->addTag('bundle', array('dispatch_event' => false));
        $definition->addMethodCall('start');
        $definition->addMethodCall('started');

        return $definition;
    }