refactored tt_parser