Class definition, cleanup, improved table creation.