Refactor on events controller