Refactor event polling and update process