move js to separate file