Replace `retry` to a class implementation.