public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $mm = $serviceLocator->get('ModuleManager');
        $mm->loadModules();
        $moduleParams = $mm->getEvent()->getParams();

        $config = ArrayUtils::merge(
            $moduleParams['configListener']->getMergedConfig(false),
            $serviceLocator->get('ApplicationConfig')
        );

        $parametersBag = $serviceLocator->get('ApplicationParameters');

        $config['parameters'] = isset($config['parameters']) ?
            ArrayUtils::merge($parametersBag->all(), $config['parameters']) :
            $config['parameters'] = $parametersBag->all();

        return $parametersBag->resolveArray($config);
    }