AddTable refactor