protected function loadPresetsFile($filename) {
    $pieces = array('templates', $this->environment->getCoreMajorVersion(), $filename);
    $path = $this->environment->getPath(implode('/', $pieces));

    if (!file_exists($path)) {
      throw new \Exception(strtr("Unable to find template at !path.", array(
        '!path' => htmlspecialchars($path, ENT_QUOTES, 'UTF-8'),
      )));
    }

    $template_file = file_get_contents($path);
    return $template_file;
  }