public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $evm    = $serviceLocator->get('EventManager');
        $config = $serviceLocator->get('Config');
        $config = empty($config['valu_so']) ? [] : $config['valu_so'];
        
        $cacheConfig = isset($config['cache']) ? $config['cache'] : null;
        
        /**
         * Configure loader
         */
        $loaderOptions = array(
            'locator' => $serviceLocator->createScopedServiceManager()
        );
        
        if (!empty($config['services'])) {
            $loaderOptions['services'] = $config['services'];
        }
        unset($config['services']);
        
        if (isset($config['use_main_locator']) && $config['use_main_locator']) {
            $peeringManager = $serviceLocator;
        } else {
            $peeringManager = null;
        }
        unset($config['use_main_locator']);
        
        // Pass other configurations as service plugin manager configuration
        if (!empty($config)) {
            
            if (isset($cacheConfig['enabled']) && !$cacheConfig['enabled']) {
                unset($config['cache']);
            } elseif (!isset($cacheConfig['adapter']) && isset($cacheConfig['service'])) {
                $cache = $serviceLocator->get($cacheConfig['service']);
                
                if ($cache instanceof StorageInterface) {
                    $config['cache'] = $cache;
                }
            }
            
            $smConfig = new ServicePluginManagerConfig($config);
            $loaderOptions['service_manager'] = $smConfig;
        }
        
        // Initialize loader
        $loader = new ServiceLoader(
            $loaderOptions
        );
        
        if ($peeringManager) {
            $loader->addPeeringServiceManager($peeringManager);
        }
        
        $broker = new ServiceBroker();
        $broker->setLoader($loader);
        $this->configureQueue($serviceLocator, $config, $broker);
        
        // Attach configured event listeners
        if (!empty($config['listeners'])) {
            EventManagerConfigurator::configure(
                $broker->getEventManager(), 
                $serviceLocator, 
                $config['listeners']);
        }
        
        $evm->trigger('valu_so.servicebroker.init', $broker);
        
        return $broker;
    }