private function overrideServices(ContainerBuilder $container, array $services)
    {
        $serviceConfig = array(
            'auth_handler' => 'ma27_api_key_authentication.auth_handler',
            'key_factory'  => 'ma27_api_key_authentication.key_factory',
        );

        foreach ($serviceConfig as $configIndex => $replaceableServiceId) {
            if (!isset($services[$configIndex]) || null === $serviceId = $services[$configIndex]) {
                continue;
            }

            $container->removeDefinition($replaceableServiceId);
            $container->setAlias($replaceableServiceId, new Alias($serviceId));
        }
    }