Refactor `io_poll`