improved the catalog queries to be able to handle masked types