tighten up some js examples