improve some function