 define ['lib/hullbase', 'handlebars'], (Hull, Handlebars)->
   init: (env)->
-    setupTemplate = (tplSrc, name) ->
+    setupTemplate = (tplSrc, tplName) ->
       compiled = env.core.template.hbs(tplSrc)
-      Handlebars.registerPartial(name, compiled)
+      Handlebars.registerPartial(tplName, compiled)
       compiled
 
     env.core.template.load = (names, ref, format="hbs")->

        # if require.defined(path)
        #   ret[tpl] = require(path)
        # else
        tplName = [widgetName, name].join("/")
        localTpl = env.core.dom.find("script[data-hull-template='#{tplName}']")
        if localTpl.length
          parsed = setupTemplate(localTpl.text(), name)
          ret[name] = parsed
          define path, parsed
        else if Hull.templates["#{tplName}"]
          parsed = setupTemplate(Hull.templates["#{tplName}"], name)
          ret[name] = parsed
          define path, parsed
        else if Hull.templates._default?["#{tplName}"]
          parsed = setupTemplate(Hull.templates._default["#{tplName}"], name)
          ret[name] = parsed
          define path, parsed
        else

          res = Array.prototype.slice.call(arguments)
          for t,i in res
            name = paths[i][0]
            tplName = [widgetName, name].join("/")
            ret[name] = setupTemplate(t, tplName)
          dfd.resolve(ret)
        , (err)->
          console.error("Error loading templates", paths, err)
