Added classes to deal with batch queries