Refactor event input.