refactor table.rb - step 4