refactor the code for better UT coverage
1. change class Table_Stats to Table_Stats_$type
2. change class Relation_Stats to Relation_Stats_$type