huge refactoring - making app and module