Simplify pread loop