Some refactoring to RetryPolicy and Paginator