Could we share this query in some common lib?