Refactor routes creating a routes helper