Improve Javascript snip.