move Table out into a class