Address PR comments

Address PR comments by changing uses of `if` without an else
clause to `when`