Refactoring in dialog classes