refactor Event.js