Move remove_duplicates to npd