Refactor mixed case handling for email