refactors app and router files