main.js cleanup