build querystring functions