Utilities for batching and retry policy