* greatly refactors the app