Refactored app.js into multiple files