Refactored table_builder to use data type instead of attribute name