refactor, allow in-place event handling