Refactor cells, rows, params in ttt.js