refactoring the order of routes

Also renaming some of the methods to be clearer.