improve JavaScript readability

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