a lot of changes related to refactoring and decoupling of the APP. This is NOT runnable version of code