diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp
index fd261b5..cdb16f4 100644
--- a/bpfloader/BpfLoader.cpp
+++ b/bpfloader/BpfLoader.cpp
@@ -118,15 +118,8 @@
         BPF_PROG_TYPE_SOCKET_FILTER,
 };
 
-struct Location {
-    const char* const dir;
-    const char* const prefix;
-    unsigned long long allowedDomainBitmask;
-    const bpf_prog_type* allowedProgTypes = nullptr;
-    size_t allowedProgTypesLength = 0;
-};
 
-const Location locations[] = {
+const android::bpf::Location locations[] = {
         // S+ Tethering mainline module (network_stack): tether offload
         {
                 .dir = "/apex/com.android.tethering/etc/bpf/",
@@ -187,7 +180,7 @@
         },
 };
 
-int loadAllElfObjects(const Location& location) {
+int loadAllElfObjects(const android::bpf::Location& location) {
     int retVal = 0;
     DIR* dir;
     struct dirent* ent;
@@ -201,11 +194,7 @@
             progPath += s;
 
             bool critical;
-            int ret = android::bpf::loadProg(progPath.c_str(), &critical,
-                                             location.prefix,
-                                             location.allowedDomainBitmask,
-                                             location.allowedProgTypes,
-                                             location.allowedProgTypesLength);
+            int ret = android::bpf::loadProg(progPath.c_str(), &critical, location);
             if (ret) {
                 if (critical) retVal = ret;
                 ALOGE("Failed to load object: %s, ret: %s", progPath.c_str(), std::strerror(-ret));
diff --git a/libbpf_android/BpfLoadTest.cpp b/libbpf_android/BpfLoadTest.cpp
index 8e853b9..0c4e6ee 100644
--- a/libbpf_android/BpfLoadTest.cpp
+++ b/libbpf_android/BpfLoadTest.cpp
@@ -53,9 +53,15 @@
         bpf_prog_type kAllowed[] = {
                 BPF_PROG_TYPE_UNSPEC,
         };
-        EXPECT_EQ(android::bpf::loadProg(progPath.c_str(), &critical, "", 0, kAllowed,
-                                         arraysize(kAllowed)),
-                  -1);
+
+        Location loc = {
+            .dir = "",
+            .prefix = "",
+            .allowedDomainBitmask = 0,
+            .allowedProgTypes = kAllowed,
+            .allowedProgTypesLength = arraysize(kAllowed),
+        };
+        EXPECT_EQ(android::bpf::loadProg(progPath.c_str(), &critical, loc), -1);
 
         EXPECT_EQ(android::bpf::loadProg(progPath.c_str(), &critical), 0);
         EXPECT_EQ(false, critical);
diff --git a/libbpf_android/Loader.cpp b/libbpf_android/Loader.cpp
index bc7ea76..5fe2e10 100644
--- a/libbpf_android/Loader.cpp
+++ b/libbpf_android/Loader.cpp
@@ -1137,9 +1137,7 @@
     return 0;
 }
 
-int loadProg(const char* elfPath, bool* isCritical, const char* prefix,
-             const unsigned long long allowedDomainBitmask, const bpf_prog_type* allowed,
-             size_t numAllowed) {
+int loadProg(const char* elfPath, bool* isCritical, const Location& location) {
     vector<char> license;
     vector<char> critical;
     vector<codeSection> cs;
@@ -1212,7 +1210,8 @@
         return -1;
     }
 
-    ret = readCodeSections(elfFile, cs, sizeOfBpfProgDef, allowed, numAllowed);
+    ret = readCodeSections(elfFile, cs, sizeOfBpfProgDef, location.allowedProgTypes,
+                           location.allowedProgTypesLength);
     if (ret) {
         ALOGE("Couldn't read all code sections in %s", elfPath);
         return ret;
@@ -1221,7 +1220,8 @@
     /* Just for future debugging */
     if (0) dumpAllCs(cs);
 
-    ret = createMaps(elfPath, elfFile, mapFds, prefix, allowedDomainBitmask, sizeOfBpfMapDef);
+    ret = createMaps(elfPath, elfFile, mapFds, location.prefix, location.allowedDomainBitmask,
+                     sizeOfBpfMapDef);
     if (ret) {
         ALOGE("Failed to create maps: (ret=%d) in %s", ret, elfPath);
         return ret;
@@ -1232,7 +1232,8 @@
 
     applyMapRelo(elfFile, mapFds, cs);
 
-    ret = loadCodeSections(elfPath, cs, string(license.data()), prefix, allowedDomainBitmask);
+    ret = loadCodeSections(elfPath, cs, string(license.data()), location.prefix,
+                           location.allowedDomainBitmask);
     if (ret) ALOGE("Failed to load programs, loadCodeSections ret=%d", ret);
 
     return ret;
diff --git a/libbpf_android/include/libbpf_android.h b/libbpf_android/include/libbpf_android.h
index 2218215..1856798 100644
--- a/libbpf_android/include/libbpf_android.h
+++ b/libbpf_android/include/libbpf_android.h
@@ -76,10 +76,16 @@
     return domainToBitmask(d) & v;
 }
 
+struct Location {
+    const char* const dir = "";
+    const char* const prefix = "";
+    unsigned long long allowedDomainBitmask = 0;
+    const bpf_prog_type* allowedProgTypes = nullptr;
+    size_t allowedProgTypesLength = 0;
+};
+
 // BPF loader implementation. Loads an eBPF ELF object
-int loadProg(const char* elfPath, bool* isCritical, const char* prefix = "",
-             const unsigned long long allowedDomainBitmask = 0,
-             const bpf_prog_type* allowed = nullptr, size_t numAllowed = 0);
+int loadProg(const char* elfPath, bool* isCritical, const Location &location = {});
 
 // Exposed for testing
 unsigned int readSectionUint(const char* name, std::ifstream& elfFile, unsigned int defVal);
