Refactor ttt.rb