refactor tableController