diff --git a/include/opendht/dht_proxy_server.h b/include/opendht/dht_proxy_server.h
index a68611e57c5a4b0d12c1b2d5fefefc87d97423be..8615f8161c54a1159d2b7f89237274c2982904c2 100644
--- a/include/opendht/dht_proxy_server.h
+++ b/include/opendht/dht_proxy_server.h
@@ -276,7 +276,7 @@ private:
 
 #ifdef OPENDHT_PUSH_NOTIFICATIONS
     PushType getTypeFromString(const std::string& type);
-    const std::string& getDefaultTopic(PushType type);
+    std::string getDefaultTopic(PushType type);
     /**
      * Subscribe to push notifications for an iOS or Android device.
      * Method: SUBSCRIBE "/{InfoHash: .*}"
diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp
index d20f49c7c9155a3a56d4d6d5889c40be63b230d4..fcab0b228f8c612e60afd020dd04498dee71b79b 100644
--- a/src/dht_proxy_server.cpp
+++ b/src/dht_proxy_server.cpp
@@ -748,30 +748,23 @@ DhtProxyServer::listen(restinio::request_handle_t request,
 
 PushType
 DhtProxyServer::getTypeFromString(const std::string& type) {
-    if (type == "android") {
+    if (type == "android")
         return PushType::Android;
-    }
-    if (type == "apple") {
-        // proxy_client is not updated or using ios < 14.5
-        return PushType::iOSLegacy;
-    }
-    if (type == "ios") {
+    else if (type == "ios")
         return PushType::iOS;
-    }
+    else if (type == "apple")
+        return PushType::iOSLegacy; // proxy_client is not updated or using ios < 14.5
     return PushType::None;
 }
 
-const std::string&
+std::string
 DhtProxyServer::getDefaultTopic(PushType type) {
-    if (bundleId_.empty()) {
+    if (bundleId_.empty())
         return {};
-    }
-    if (type == PushType::iOSLegacy) {
-        return bundleId_  + ".voip";
-    }
-    if (type == PushType::iOS) {
+    if (type == PushType::iOS)
         return bundleId_;
-    }
+    else if (type == PushType::iOSLegacy)
+        return bundleId_  + ".voip";
     return {};
 }
 
@@ -1201,14 +1194,12 @@ DhtProxyServer::put(restinio::request_handle_t request,
                     // cancel permanent put
                     pput.expireTimer = std::make_unique<asio::steady_timer>(ctx, timeout);
 #ifdef OPENDHT_PUSH_NOTIFICATIONS
-                    if (not pushToken.empty()){
-                        bool isAndroid = platform == "android";
+                    if (not pushToken.empty()) {
                         pput.pushToken = pushToken;
                         pput.clientId = clientId;
                         pput.type = getTypeFromString(platform);
-                        if (topic.empty()) {
+                        if (topic.empty())
                             topic = getDefaultTopic(pput.type);
-                        }
                         pput.topic = topic;
                         pput.sessionCtx = std::make_shared<PushSessionContext>(sessionId);
                         // notify push listen expire