Refactor methods in chat_ctrl