The block in this `if` statement should probably be encapsulated in a helper function, so that the branches in this method are clearer.