move JS to js file