Use when.
Misc simplification.