Refactoring a monstrosity using XState 5 - Implementation challenges leave me unsure about moving it to production