Refactoring message API pass one.