refactoring dialog classes