refactoring /chats