Extracted another helper method

les duplicated code between runSegment() and retry()