JavaScript snippets fine tuning.