file cleanup and modification