WIP mode change.
Preliminary work on mode switch.