fixed app routing
minor refactoring