More consistent JavaScript style as per @ahgittin