refactored ttt