clean up javascript