Code refactoring and comments for TS Fragment