delete useless code and formate code