   ([^String template context]
    (let [reader (StringReader. template)
          template (.compile +mustache-factory+ reader "example")]
-     (render template context))))
+     (render* template context))))
 
-(defn render-resource
+(defn render
   "Load a file from the class path and render
   it using mustache template."
   ([^String path]
    (render-resource path {}))
   ([^String path context]
-   (let [template (.compile +mustache-factory+ path)]
-     (render template context))))
+   (render-string (slurp (io/resource path)) context)))

  ^DefaultMustacheFactory
  +mustache-factory+ (DefaultMustacheFactory.))

(defn- render
  [^Mustache template context]
  (with-out-str
    (let [scope (HashMap. (walk/stringify-keys context))]

(ns continuo.util.template
  "A lightweight abstraction over mustache.java
  template engine."
  (:require [clojure.walk :as walk]
            [clojure.java.io :as io])
  (:import java.io.StringReader
           java.io.StringWriter
           java.util.HashMap
