Smarter way to gather table name from structure