refactoring for new dialogs