Added support for TLG0; refactoring