clean up find_duplicates based code