refactoring ttt.rb