protected function createTwigEnvironment(array $options)
    {
        if (!isset($options['path'])) {
            throw new \BadMethodCallException("'path' option is required");
        }

        $loader = new \Twig_Loader_Filesystem();
        $this->addLoaderPaths($loader, $options['path']);
        
        return new \Twig_Environment($loader, $options);
    }