refactor table.rb - step 3