finding resource, matching cgi config, extracting visitorId cookie, commonize more stuff