cleaning up main.js