Clean up main.js a bit.