Refactore dialogs.