Clean up the table traversal functions