Make dupe checks more efficient.