pubsub refactor

resolves #98