Clean up 'when/is/otherwise' code contructs.