separated out javascript