I'm not sure which is better. It may be that @alex prefers your original patch. I think I would pull this out into maybe another method, actually. Not sure, though.