minor JavaScript optimization