events controller refactored