efficient fn call for buildquery