separated the javascript