Move JS to separate file