Revert "Replace use of dict for duplicate removal".