write to file
remove redundant file