Improve some utils