Refactored events controller