Moved chat logic to a separate class to accommodate for team chat