Refactoring to simplify switch calls.
switch
This should tackle the rest of the calls identified in #569.
Note that further refactoring is possible (needed), but we might want to have specific issues for each of those.