refactor the DialogHelper class