Query factory added