refactor: parse message to be sent in msg-history