private function createService(string $resolvedName, array $options = null)
    {
        try {
            if (isset($this->delegators[$resolvedName])) {
                $object = $this->createServiceFromDelegator($resolvedName, $options);
            } else {
                $object = $this->createServiceFromFactory($resolvedName, $options);
            }
        } catch (ContainerException $exception) {
            throw $exception;
        } catch (Exception $exception) {
            throw ServiceNotCreatedException::fromException($resolvedName, $exception);
        }

        foreach ($this->initializers as $initializer) {
            $initializer($this->creationContext, $object);
        }

        return $object;
    }