Improve javascript snip.