Parameterize maximum retries