public function get($id)
    {
        if (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        if (!isset($this->keys[$id])) {
            throw new NotFoundException(sprintf(
                'The service "%s" is not found',
                $id
            ));
        }

        if (isset($this->values[$id])) {
            return $this->values[$id];
        }

        if (! $this->keys[$id]) {
            if (isset($this->factories[$id])) {
                return $this->createFromFactory($this->factories[$id]);
            } else {
                return $this->createFromDefinition($this->definition[$id]);
            }
        }

        if (isset($this->factories[$id])) {
            $service = $this->createFromFactory($this->factories[$id]);
            unset($this->factories[$id]);
        } else {
            $service = $this->createFromDefinition($this->definition[$id]);
            unset($this->definition[$id]);
        }

        $this->values[$id] = $service;
        $this->immutable[$id] = true;
        return $service;
    }