performance tweaks for scoreDuplicates