cleaned up GetTable and added tests