optimizing retries