Rewrite Chat classes and Chatbox