Refactor to save marks per-file.