Refactor IOReader a bit.