Improved case statement