Refactors events controller