split into queries