Moved Event Handling to a separate module