simplify db querying