More refactoring of output files