improving routes and general refactoring