beautify events.js