not fond of this one, but I'm not sure it's worth a merge