Refactor for the message constructor.