move CDXQuery to seperate file