Started refactoring models/table.rb