Modes/Routines should be Mode/Environment/Event

That’s a bit harsh, I’d say. Check out Rule Machine if you want the type of structure you are describing.