worker shutdown refactored