factor out Types.Event