Use MVars instead of RecursiveDo to avoid circular dependencies.