Moving JS to external file