began refactoring app.ts