cleans up javascript