Performance enhancements, and actual writing to disk