refactor worker