Code cleanup on main.js.