chatting refactored