   # @param	function
   # @return	void
   #
-  render: ($view, $data = {}, $next) =>
+  render: ($view, $data = {}, $next) ->
 
     #
-    # View Controller constructor
+    # Inner Controller class
     #
-    #   Wrap view data with controller methods
-    #   This gives the view access to all methods and
-    #   properties of the controller
-    #
-    # @access	private
-    # @param	object
-    #
-    Controller = ($data) ->
-      for $key, $obj of $data
-        @[$key] = $obj
-      return
+    class Controller
+
+      #
+      # Wrap view data with controller methods
+      # This gives the view access to all methods and
+      # properties of the controller
+      #
+      # @access	private
+      # @param	object
+      #
+      constructor: ($data) ->
+        for $key, $obj of $data
+          @[$key] = $obj
 
     # Here's the magic -
     # expose the current controller via the prototype

  # @param	string
  # @return	void
  #
  redirect: ($url) =>
    #
    # ------------------------------------------------------
    #  Is there a "post_controller" hook?
    # ------------------------------------------------------
    #
    Exspresso.hooks._call_hook 'post_controller', @
    @res.redirect $url

  #
  # Async job queue for the controller
  #
  # @access	public
  # @param	function
  # @return	array
  #
  queue: ($fn) =>
    if $fn then @_queue.push($fn) else @_queue

  #
  # Run the functions in the queue
  #
  #   @access	public
  #   @param  array
  #   @param	function
  #   @return	void
  #
  run: ($queue, $next) =>

    if typeof $next isnt 'function'
      [$queue, $next] = [@_queue, $queue]

    $index = 0
    $iterate = ->

      if $queue.length is 0 then $next null
      else
        #
        # call the function at index
        #
        $ctor = $queue[$index]
        $ctor ($err) ->
          if $err
            log_message 'debug', 'Controller::run'
            console.log $err

          $index += 1
          if $index is $queue.length then $next null
          else $iterate()

    $iterate()




      module    : {enumerable: true, writeable: false, value: $module}
      class     : {enumerable: true, writeable: false, value: $class}
      method    : {enumerable: true, writeable: false, value: $method}
      queue     : {enumerable: true, writeable: false, value: $this.queue}
      run       : {enumerable: true, writeable: false, value: $this.run}
      redirect  : {enumerable: true, writeable: false, value: $this.redirect}
      render    : {enumerable: true, writeable: false, value: $this.render}
      config    : {enumerable: true, writeable: false, value: Exspresso.config}
      server    : {enumerable: true, writeable: false, value: Exspresso.server}
      router    : {enumerable: true, writeable: false, value: Exspresso.router}
      lang      : {enumerable: true, writeable: false, value: Exspresso.lang}

    $BM.mark 'loading_time:_base_classes_start'
    __defineProperties $this,
      load      : {enumerable: true, writeable: false, value: load_new('Loader',  'core', $this)}
      uri       : {enumerable: true, writeable: false, value: load_new('URI',     'core', $this)}
      input     : {enumerable: true, writeable: false, value: load_new('Input',   'core', $this)}

    __defineProperties $this,
      output    : {enumerable: true, writeable: false, value: load_new('Output',  'core', $this)}
      $_SERVER  : {enumerable: true, writeable: false, get: -> $this.input.server()}
      $_GET     : {enumerable: true, writeable: false, get: -> $this.input.get()}
      $_POST    : {enumerable: true, writeable: false, get: -> $this.input.post()}
