Refactored appRouter.js and app.js