extract common func to utility.func file