refactor loads in pubsub