public function getRenderer($name)
    {
        // default
        if ($name === null) {
            if ($this->defaultRenderer !== null) {
                $name = $this->defaultRenderer;
            } else if (count($this->renderers) > 0) {
                $name = key($this->renderers);
            }
        }

        if (!isset($this->renderers[$name])) {
            throw new InvalidArgumentException("Renderer with name '$name' doesn't exist.");
        }

        if (is_string($this->renderers[$name])) {
            $renderer = new $this->renderers[$name]();
            $reflection = ClassType::from($renderer);
            if (!$reflection->isSubclassOf('Smf\Menu\Renderer\IRenderer')) {
                throw new InvalidArgumentException("Renderer class '{$this->renderers[$name]}' is not subclass of Smf\\Menu\\Renderer\\IRenderer");
            }
            $this->renderers[$name] = $renderer;
        }

        return $this->renderers[$name];
    }