refactored the table_data