table refactor WIP