Move more file IO to process context