fix code ,tidy code format,remove some unused code