Nested `if`s could be combined