moved event definition handling to util class (issue #25)