Refactored Table functionality