simplified duplicate removal