Application and Router refactor