Moving routing logic to routing.js