condensed case statement for refactored solution