dialog manager refactoring