Use pipes intead of reading whole file into memory