improved js style