remove duplicates with DRY