refactor pubsub pool