make get_table_rows and get_table_columns simpler