Refactor Table class