events.js re-factoring - part #1