removed code duplicates