Simplify retry counting logic