refactor print data file