return null;
   }
 
+  var URL = _get_URL(site, element);
+  if (!URL) {
+    DDL_log('DirectDL (' + site.pageURL + '): cannot get the URL.');
+    return null;
+  }
+
+  return _add_link(site, URL);
+}
+
+function _get_URL(site, element) {
   var content = element.innerHTML;
   if (!content) {
     DDL_log('DirectDL (' + site.pageURL + '): content is null, cannot find URL.');
   }
   var URL = matches[1];
 
+  return URL;
+}
+
+function _add_link(site, URL) {
+
   var links = document.getElementById(site.linkDest);
   if (!links) {
     DDL_log('DirectDl (' + site.pageURL + '): Cannot add the direct download link.');