Move js snippet to own