remove dependency on pubsub by using internal publish api