refactor TableLayout