working on unified query structure