Refactored test worker.