diff --git a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java
+++ b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java
@@ -1146,15 +1146,11 @@ public abstract class WebDriverManager {
             String browserVersionOutput = getBrowserVersionInWindows(
                     programFilesEnv, winBrowserName, browserBinaryPath);
             if (isNullOrEmpty(browserVersionOutput)) {
-                String otherProgramFilesEnv = getOtherProgramFilesEnv();
                 browserVersionOutput = getBrowserVersionInWindows(
-                        otherProgramFilesEnv, winBrowserName,
+                        getOtherProgramFilesEnv(), winBrowserName,
                         browserBinaryPath);
-                if (!isNullOrEmpty(browserVersionOutput)) {
-                    return Optional
-                            .of(getVersionFromWmicOutput(browserVersionOutput));
-                }
-            } else {
+            }
+            if (!isNullOrEmpty(browserVersionOutput)) {
                 return Optional
                         .of(getVersionFromWmicOutput(browserVersionOutput));
             }
Smell-fix: refactor method to reduce cognitive complexity