separate out the javascript