[5.0] Use contract for MessageBag