Address code review comments.

1 job for fix-some-code-smells-and-duplications in 11 minutes and 28 seconds (queued for 5 seconds)