public function add($name, $template)
    {
        if (array_key_exists($name, $this->templates)) {
            throw new \InvalidArgumentException('Template already exists.');
        }

        $this->templates[$name] = $template;
    }