finished first phase of the app flow + more refactoring