Super minor point, but let's use `when` instead of `if`, when we are not using the `else` clause.