remove some unused code and add some comment