route methods and general refactoring