Modularized the application and added a router.