Improved how tables are created. Changed scoping to allows unit test access.