refactor redundant Gr_Chats structure and implement callbacks