Implemented the table execute method, and cleanup a lot of code and duplicate code.