move the query on ResourceBase