Share code between the two different uniquess constraints