refactor event controller