refactoring, optimistic retry made optional