r23151: Re-arrange the logic so it looks identical to the