refactor ChatUtil