address DanH’s comments:
 - typos
 - small code style refactors