Move metadata to Message class and rename to envelope