refactorig of dialog vars