Refactoring app.ts