delete useless files and update references