Factor out getEventMessages method.