Rework retry logic