Refactor Message struct, and add some comments.