altered the structure of javascript file