Commit #15: refactoring main.js