Refactored delay for duration