move JS to external file