add routes, refactor