use factory for query workers