clean js snippet