public function getTemplatePath($namespace = null)
    {
        if (null !== $namespace && ! is_string($namespace)) {
            throw new Exception\InvalidNamespaceException('Namespace must be a string');
        }

        $namespace = $namespace ?: self::DEFAULT_NAMESPACE;

        if (! array_key_exists($namespace, $this->paths)) {
            $this->paths[$namespace] = new SplStack;
        }

        return $this->paths[$namespace];
    }