Nit: move the `else` up. (Applies twice below in this function too.)