finished events, refactored code