Improve the query to the catalog for include some more use cases.