Tidy up example code in pubsub docs