Refactoring how annotated messages are formed