TT - some refactoring and comments