Improve some fucntion