Refactored case statement into specific classes