Refactorijg of dialogs