Restored the publish function and simplified the event adapter.