refactored, improved event handling