remove code duplicates