chat refactor started