made some cosmetic changes to events.js