cleaning up main js file