Moved query string out into library.