Improve some function