Faster duplicates detection by using NSHashMaps in Database.m