Refactored worker test