Refactor routes file