some changes, will rename private fuction(begin with a singe '_')