Optimize sending of batch messages