worker state refactored