Moved file writing to per-entry