split out javascript