refactored lowercasing