Merge case statements to remove redundant code.