private function createTwigEnvironment()
    {
        $twigEnv = new Twig_Environment(
            $this->getLoader(),
            $this->getOptions()
        );

        if ($this->options['debug']) {
            $twigEnv->addExtension(new Twig_Extension_Debug());
        }

        return $twigEnv;
    }