remove some code in functions
fix some style