move js to js file