Minor code duplicates removed