tidy events.py somewhat