Refactored Table code and added another test