I had a hard time understanding this code the first time I read it, so I separated it like this made it clearer. Having those two `if` statements on the same level highlights the symmetry between the two cases, which you would lose if you merged the `else` and the `if`.