Remove unneeded duplicates