protected function loadProfiles(array $profiles, ContainerBuilder $container)
    {
        foreach ($profiles as $profileName => $profile) {
            $definition = $container
                ->register(
                    'elcodi.sitemap_profile.' . $profileName,
                    'Elcodi\Component\Sitemap\Profile\SitemapProfile'
                )
                ->addArgument(new Reference($profile['languages']))
                ->setPublic(true);

            foreach ($profile['builders'] as $builderReference) {
                $definition->addMethodCall(
                    'addSitemapDumper',
                    [new Reference('elcodi.sitemap_dumper.' . $builderReference)]
                );
            }
        }

        return $this;
    }