further separated the javascript