Refactoring main.js to multiple models and modules