Moved event listeners to main.js