refining the main js file