extract the create worker method.