I'd rather not - they're pretty simple and readable as is, and while there's a small amount to be gained from factoring it out I think it wouldn't achieve very much (and any future changes are likely to affect only one, not both, because I bet the gnarly bugs will be from databases where uniques and indexes are not comparable)