Noticing that a function could have an early exit to save a level of indentation lead to a larger refactor. Slight code improvements besides the formatting change.