Improved JavaScript style