dialog - code cleanup