Refactor populate table to use the AddToTable method