nitcc: simplify the code of trans generation into two steps