Refactor Events controller and model