cleaned up main.js file a bit: master