Prepare for genearting query list function.