Make table classes generic and move to separate file.