refactoring complete, app working