Split up events.rb into logical units.