make buildQuery() private