private function loadClients(array $clients, ContainerBuilder $container)
    {
        foreach ($clients as $name => $clientConfig) {
            $clientId = sprintf('phlexible_elastica.client.%s', $name);
            $clientDef = new DefinitionDecorator('phlexible_elastica.client_prototype');
            $clientDef->replaceArgument(0, $clientConfig);
            $logger = $clientConfig['connections'][0]['logger'];
            if (false !== $logger) {
                $clientDef->addMethodCall('setLogger', array(new Reference($logger)));
            }
            $clientDef->addTag('phlexible_elastica.client');
            $container->setDefinition($clientId, $clientDef);
            $this->clients[$name] = array(
                'id' => $clientId,
                'reference' => new Reference($clientId),
            );
        }
    }