     matches = url.match obj.regex
 
     if matches
-      merge params, zipObject(obj.keys, matches.slice(1))
 
-      stopRoute = false
-      _.each obj.filters.before, (filter) ->
-        if !stopRoute && filter(params) == false
-          stopRoute = true
-      if stopRoute
-        return
-      
-      obj.callback params
+      new LiveView "/views" + url + ".html", {}, (view) -> 
+        ctor = getHelper url
+        if ctor?
+          helper = new ctor(view)
+        else 
+          helper = () ->
+        merge params, zipObject(obj.keys, matches.slice(1))
+        methods = { 
+                    url: url,
+                    view: view, 
+                    autoRender: true
+                    helper: helper
+                  }
+        
+        stopRoute = false
+        _.each obj.filters.before, (filter) ->
+          if !stopRoute && filter.call(methods, params) == false
+            stopRoute = true
+        if stopRoute
+          return
 
-      _.each obj.filters.after, (filter) ->
-        filter(params)
+        obj.callback.call methods, params 
 
-      if push
-        window.history.pushState { method: method, params: params }, "", url
+        _.each obj.filters.after, (filter) ->
+          filter(params)
+
+        if push
+          $("body").attr("class", url.replace(/\//g, " ").trim())
+          window.history.pushState { method: method, params: params }, "", url
+        if(methods.autoRender)
+          $("#main").html(methods.view.context)
       return
 
 registerRoute = (method, route, filters, callback) ->

window.Controller = Controller
window.Router = {
  get: (url, push) ->
    matchRoute("get", url, push)

  post: (url, params, push) ->
    matchRoute("post", url, params, push)

    matchRoute("put", url, params, push)

  delete: (url, push) ->
    matchRoute("delete", url, {}, push)
}
