Added new type-safe event system