refactored pool and stanalone worker