A factory function for event interfaces