factor our file writes.