clean up javascript a little bit