In general I prefer to eliminate all nested `if` statements. I'm refactoring this bit of the code for the merge commit.