refactor tablify