Refine the API for selective retry