cleaning up events controller and events.js code