document worker refactor