private function buildServiceConfig()
    {
        if ($this->serviceConfig->keyExists('Factory') && !$this->serviceConfig->keyExists('Method')) {
            throw new ServiceManagerException(ServiceManagerException::FACTORY_SERVICE_METHOD_KEY_MISSING,
                                              [$this->serviceName]
            );
        }

        $config = new ServiceConfig();
        $config->setClass($this->serviceConfig->key('Class', null, true));
        $config->setArguments($this->serviceConfig->key('Arguments', [], true));
        $config->setCalls($this->serviceConfig->key('Calls', [], true));
        $config->setScope($this->serviceConfig->key('Scope', ServiceScope::CONTAINER, true));
        $config->setFactory($this->serviceConfig->key('Factory', null, true));
        $config->setMethod($this->serviceConfig->key('Method', null, true));
        $config->setMethodArguments($this->serviceConfig->key('MethodArguments'));
        $config->setStatic($this->serviceConfig->key('Static', true, true));

        return $config;
    }