private function commandBus(ContainerBuilder $container, $user, $isApi = false)
    {
        $apiPartName = $isApi ? '_api' : '';
        $busId = 'bengor.user.simple_bus_' . $user . $apiPartName . '_command_bus';
        $middlewareTag = 'bengor_user_' . $user . '_command_bus_middleware';
        $handlerTag = 'bengor_user_' . $user . $apiPartName . '_command_bus_handler';

        // Define the command bus for the given user type
        // The middleware tag string will be later used to add
        // required middleware to this specific command bus
        $container->setDefinition(
            $busId,
            (new Definition(
                MessageBusSupportingMiddleware::class
            ))->addTag('message_bus', [
                'type'           => 'command',
                'middleware_tag' => $middlewareTag,
            ])->setPublic(false)
        );

        // Find services tagged with $middlewareTag string and add
        // them to the current user type's command bus
        (new ConfigureMiddlewares($busId, $middlewareTag))->process($container);

        // Declares callable resolver for the current user type's command bus
        $container->setDefinition(
            'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.callable_resolver',
            (new Definition(
                ServiceLocatorAwareCallableResolver::class, [
                    [
                        new Reference('service_container'), 'get',
                    ],
                ]
            ))->setPublic(false)
        );

        // Declares class based command name resolver for the current user type's command bus
        $container->setDefinition(
            'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.class_based_command_name_resolver',
            (new Definition(
                ClassBasedNameResolver::class
            ))->setPublic(false)
        );

        // Declares the handler map for the current user type's command bus,
        // will contain the association between commands an handlers
        $container->setDefinition(
            'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.command_handler_map',
            (new Definition(
                CallableMap::class, [
                    [],
                    $container->getDefinition(
                        'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.callable_resolver'
                    ),
                ]
            ))->setPublic(false)
        );

        // Declares the handler resolver with the NameResolver
        // strategy and HandlerMap key values for Command => Handler
        $container->setDefinition(
            'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.command_handler_resolver',
            (new Definition(
                NameBasedMessageHandlerResolver::class, [
                    $container->getDefinition(
                        'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.class_based_command_name_resolver'
                    ),
                    $container->getDefinition(
                        'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.command_handler_map'
                    ),
                ]
            ))->setPublic(false)
        );

        // Declares the Handler
        $container
            ->findDefinition(
                'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.delegates_to_message_handler_middleware'
            )
            ->addArgument(
                $container->getDefinition(
                    'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.command_handler_resolver'
                )
            )->setPublic(false);

        // Declares the tag that will be used to associate the
        // handlers to the current user type's command bus
        (new RegisterHandlers(
            'bengor_user.simple_bus_bridge_bundle.' . $user . '_command_bus.command_handler_map',
            $handlerTag,
            'handles'
        ))->process($container);

        // Decorate SimpleBus' command bus with BenGorUser's command bus

        $apiPartName = $isApi ? '.api_' : '.';
        $container->setDefinition(
            'bengor_user.' . $user . $apiPartName . 'command_bus',
            new Definition(
                SimpleBusUserCommandBus::class, [
                    $container->getDefinition($busId),
                ]
            )
        );
    }