refactoring app JS (Modules)