refactor and delete useless files