removing duplicated code
normalize conditional on retry or delete call
Merge pull request #1702 from lucianosousa/patch-2

removing duplicated code