use when instead of if when no else branch