began refactoring app.ts
most functionality working again