nice option for refactoring to convert it to `case` statement