Refactoring routes, removing unused code