[REFACTOR] improve chat view logic