improve some example codes