use `if` instead of `case`
improve naming