more routes and refactor