Fewer lines of code. Would there be a benefit from using `match` instead of `if` here?