Second pass cleaning.  Moved duplicate CURL calls into new function.