(refactor) change architecture to mimic ionic app