Refactorized code to support sleep time while retries