improve JavaScript readability

Reviewed in https://codereview.appspot.com/7314108/