Dialog, refactoring