refactor routes