Dialogs refactoring