cleaning code duplicates