add IOStream.safe_close()
rename files & copy code