refactor dialog tools