Reduced number of writes to file