add benchmark
refactor events
small refactoring
add benchmark tests for event handling