Added discriminated events functionality.