Added Table class and refactored code into Table.