Hmm I guess it'd be tricky with the retry var but it'd be great to pull this out into a separate method. It'd be a bit more descriptive, could possibly get rid of a begin/end, etc.