Add timeout to waiting for job before deleting document set
Extract common functionality
Move documentSetId into state
Simplify conditional