worker refactor