refactor batch-messaging