Refactoring 1: Extract method - case statement