reduce compile warning, and remove some useless code