Refactoring initialize logic out into app.js