query class structure