```ruby
alias_method :serialize_event, defined?(Oj) ? :serialize_oj : :serialize_to_json
```