     else
         VM.loadExtraEditPageData subpage
 
-    setInner()
-    $('#main').html(HAML['edit']({project: project_name}))
-    $('#subpage').html(HAML['edit_' + subpage]({}))
-    ko.applyBindings(VM)
-
+    display "edit", {project: project_name}, subpage
 
   loadAccountPage: (cx, [subpage, hash]) =>
     subpage or= "notifications"

CI.ajax.init()

setInner = =>
  $('html').removeClass('outer').removeClass('new-outer').addClass('inner')

display = (template, args) ->
  setInner()
  $('#main').html(HAML[template](args))
  ko.applyBindings(VM)

splitSplat = (cx) ->

    else if subpage is "api"
      @current_user().load_tokens()

    display "account", {}, subpage, hash


  renderAdminPage: (subpage) =>
    display "admin", {}, subpage

  loadAdminPage: (cx) =>
    @renderAdminPage ""
