Dialog is refactored.