Use file handles for reading and writing instead of keeping data in memory