add table spec
Refactor