public function loadTemplate($template)
    {
        if (!$this->isLoaded($identity = $this->findIdentity($template))) {

            if (!$this->supports($identity)) {
                throw new \InvalidArgumentException(sprintf('Unsupported template "%s".', $identity->getName()));
            }

            $this->setLoaded($identity, $this->getLoader()->load($identity));
        }

        return $this->getLoaded($identity);
    }