refactoring exchange message