Chatclient: some code cleanup