retryable upload + refactoring