move event message formatting into a callback