refactoring: gen functions migration for tpl tp parsing.py