some refactors at tg codebase

hover at commit message