diff --git a/module/VuFind/src/VuFind/Connection/WorldCatUtils.php b/module/VuFind/src/VuFind/Connection/WorldCatUtils.php
index c25f0a0bd1145019c1eec1a84e13d5b863fc379d..f8912406ffb56d27207ddf7268f9f49d9bd626ba 100644
--- a/module/VuFind/src/VuFind/Connection/WorldCatUtils.php
+++ b/module/VuFind/src/VuFind/Connection/WorldCatUtils.php
@@ -443,30 +443,11 @@ class WorldCatUtils implements \Zend\Log\LoggerAwareInterface
         $narrower = array();
 
         while ($record = $marc->next()) {
-            // Get exact terms:
-            $actual = $record->getField('150');
-            if ($actual) {
-                $main = $actual->getSubfield('a');
-                if ($main) {
-                    // Some versions of File_MARCXML seem to have trouble returning
-                    // strings properly (giving back XML objects instead); let's
-                    // cast to string to be sure we get what we expect!
-                    $main = (string)$main->getData();
-
-                    // Add subdivisions:
-                    $subdivisions = $actual->getSubfields('x');
-                    if ($subdivisions) {
-                        foreach ($subdivisions as $current) {
-                            $main .= ', ' . (string)$current->getData();
-                        }
-                    }
-
-                    // Only save the actual term if it is not a subset of the
-                    // requested term.
-                    if (!stristr($term, $main)) {
-                        $exact[] = $main;
-                    }
-                }
+            // Get exact terms; only save it if it is not a subset of the requested
+            // term.
+            $main = $this->getExactTerm($record);
+            if ($main && !stristr($term, $main)) {
+                $exact[] = $main;
             }
 
             // Get broader/narrower terms:
@@ -506,4 +487,34 @@ class WorldCatUtils implements \Zend\Log\LoggerAwareInterface
             'narrower' => array_unique($narrower)
         );
     }
+
+    /**
+     * Extract an exact term from a MARC record.
+     *
+     * @param \File_MARC_Record $record MARC record
+     *
+     * @return string
+     */
+    protected function getExactTerm($record)
+    {
+        // Get exact terms:
+        $actual = $record->getField('150');
+        if (!$actual || !($main = $actual->getSubfield('a'))) {
+            return false;
+        }
+
+        // Some versions of File_MARCXML seem to have trouble returning
+        // strings properly (giving back XML objects instead); let's
+        // cast to string to be sure we get what we expect!
+        $main = (string)$main->getData();
+
+        // Add subdivisions:
+        $subdivisions = $actual->getSubfields('x');
+        if ($subdivisions) {
+            foreach ($subdivisions as $current) {
+                $main .= ', ' . (string)$current->getData();
+            }
+        }
+        return $main;
+    }
 }
\ No newline at end of file
diff --git a/module/VuFindDevTools/src/VuFindDevTools/Controller/DevtoolsController.php b/module/VuFindDevTools/src/VuFindDevTools/Controller/DevtoolsController.php
index 6ec573a152af68368f4bbc63dbadb034034d4674..5576e53b55666f1863871793ec08f29e3f52f78b 100644
--- a/module/VuFindDevTools/src/VuFindDevTools/Controller/DevtoolsController.php
+++ b/module/VuFindDevTools/src/VuFindDevTools/Controller/DevtoolsController.php
@@ -114,14 +114,7 @@ class DevtoolsController extends \VuFind\Controller\AbstractBase
     protected function findMissingLanguageStrings($lang1, $lang2)
     {
         // Find strings missing from language 2:
-        $notInL2 = array();
-        $l2Keys = array_keys((array)$lang2);
-        foreach ($lang1 as $key => $junk) {
-            if (!in_array($key, $l2Keys)) {
-                $notInL2[] = $key;
-            }
-        }
-        return $notInL2;
+        return array_diff(array_keys((array)$lang1), array_keys((array)$lang2));
     }
 
     /**