factor out parseQueryString