overhaul with mode switching in mind