Adjusting code to Google's JS style guide