Js make structure

Changes for giving proper structure to javascript