move trans related func to trans.go