MessageContext refactoring