Move javascripts to separate file