batch-messaging refactor