 
 StringUril = require 'theoricus/utils/string_util'
 Route = require 'theoricus/core/route'
-History = require ':history'
+Routes = require 'app/config/routes'
+
+require ':history'
 
 Factory = null
 

      url = "/#{url}" if (url.slice 0, 1) isnt '/'

      # fallback to root url in case user enter the '/'
      url = app.root if url == "/"

      for route in @routes
        if route.matcher.test url

  constructor:( @the, @on_change )->
    Factory = @the.factory

    for route, opts of Routes.routes
      @map route, opts.to, opts.at, opts.el, @

    History.Adapter.bind window, 'statechange', =>
