public function getTemplate($domain, $name)
    {
        if (!isset($this->templates[$domain][$name])) {
            throw new \InvalidArgumentException(sprintf(
                'Template with name "%s" in domain "%s" has not been registered',
                $name,
                $domain
            ));
        }

        return $this->templates[$domain][$name];
    }