Some cleanup in main.js