(#3262) - Minor style fixes

Inlined some unnecessary function calls, extraced some re-used logic,
indented a few things.
Agreed. I was just blindly copying the existing logic. Will fix.