Remove excessive IO.select