refactored the routing function in main.js