Separation of the output file generation