refactored case statement that wasn't making use of implicit return