Update with review suggestions

 - formatting fixes
 - extract common usages

Change-Id: Ia09ad3e1f07a4f52471e5d0b72faf44e93a97591