Allow query sources to be reused

Signed-off-by: Tom Wright <tom@inflatablecookie.com>