Better duplicate detection