diff --git a/src/name.cpp b/src/name.cpp
index ba6c146..f8b9a8c 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -55,13 +55,57 @@
 }
 
 Name::Name(const char* uri)
+  : Name(std::string(uri))
 {
-  construct(uri);
 }
 
-Name::Name(const std::string& uri)
+Name::Name(std::string uri)
 {
-  construct(uri.c_str());
+  trim(uri);
+  if (uri.empty())
+    return;
+
+  size_t iColon = uri.find(':');
+  if (iColon != std::string::npos) {
+    // Make sure the colon came before a '/'.
+    size_t iFirstSlash = uri.find('/');
+    if (iFirstSlash == std::string::npos || iColon < iFirstSlash) {
+      // Omit the leading protocol such as ndn:
+      uri.erase(0, iColon + 1);
+      trim(uri);
+    }
+  }
+
+  // Trim the leading slash and possibly the authority.
+  if (uri[0] == '/') {
+    if (uri.size() >= 2 && uri[1] == '/') {
+      // Strip the authority following "//".
+      size_t iAfterAuthority = uri.find('/', 2);
+      if (iAfterAuthority == std::string::npos)
+        // Unusual case: there was only an authority.
+        return;
+      else {
+        uri.erase(0, iAfterAuthority + 1);
+        trim(uri);
+      }
+    }
+    else {
+      uri.erase(0, 1);
+      trim(uri);
+    }
+  }
+
+  size_t iComponentStart = 0;
+
+  // Unescape the components.
+  while (iComponentStart < uri.size()) {
+    size_t iComponentEnd = uri.find("/", iComponentStart);
+    if (iComponentEnd == std::string::npos)
+      iComponentEnd = uri.size();
+
+    append(Component::fromEscapedString(&uri[0], iComponentStart, iComponentEnd));
+    iComponentStart = iComponentEnd + 1;
+  }
 }
 
 Name
@@ -123,71 +167,6 @@
   m_nameBlock.parse();
 }
 
-void
-Name::construct(const char* uriOrig)
-{
-  clear();
-
-  std::string uri = uriOrig;
-  trim(uri);
-  if (uri.size() == 0)
-    return;
-
-  size_t iColon = uri.find(':');
-  if (iColon != std::string::npos) {
-    // Make sure the colon came before a '/'.
-    size_t iFirstSlash = uri.find('/');
-    if (iFirstSlash == std::string::npos || iColon < iFirstSlash) {
-      // Omit the leading protocol such as ndn:
-      uri.erase(0, iColon + 1);
-      trim(uri);
-    }
-  }
-
-  // Trim the leading slash and possibly the authority.
-  if (uri[0] == '/') {
-    if (uri.size() >= 2 && uri[1] == '/') {
-      // Strip the authority following "//".
-      size_t iAfterAuthority = uri.find('/', 2);
-      if (iAfterAuthority == std::string::npos)
-        // Unusual case: there was only an authority.
-        return;
-      else {
-        uri.erase(0, iAfterAuthority + 1);
-        trim(uri);
-      }
-    }
-    else {
-      uri.erase(0, 1);
-      trim(uri);
-    }
-  }
-
-  size_t iComponentStart = 0;
-
-  // Unescape the components.
-  while (iComponentStart < uri.size()) {
-    size_t iComponentEnd = uri.find("/", iComponentStart);
-    if (iComponentEnd == std::string::npos)
-      iComponentEnd = uri.size();
-
-    append(Component::fromEscapedString(&uri[0], iComponentStart, iComponentEnd));
-    iComponentStart = iComponentEnd + 1;
-  }
-}
-
-void
-Name::set(const char* uri)
-{
-  *this = Name(uri);
-}
-
-void
-Name::set(const std::string& uri)
-{
-  *this = Name(uri);
-}
-
 std::string
 Name::toUri() const
 {
diff --git a/src/name.hpp b/src/name.hpp
index 986ef8f..3817947 100644
--- a/src/name.hpp
+++ b/src/name.hpp
@@ -105,7 +105,7 @@
    * @brief Create name from @p uri (NDN URI scheme)
    * @param uri The URI string
    */
-  Name(const std::string& uri);
+  Name(std::string uri);
 
   /**
    * @brief Make a deep copy of the name, reallocating the underlying memory buffer
@@ -133,20 +133,6 @@
   hasWire() const;
 
   /**
-   * @deprecated Use appropriate constructor
-   */
-  DEPRECATED(
-  void
-  set(const char* uri));
-
-  /**
-   * @deprecated Use appropriate constructor
-   */
-  DEPRECATED(
-  void
-  set(const std::string& uri));
-
-  /**
    * @brief Append a new component, copying from value of length valueLength.
    * @return This name so that you can chain calls to append.
    */
@@ -613,10 +599,6 @@
     return const_reverse_iterator(begin());
   }
 
-private:
-  void
-  construct(const char* uri);
-
 public:
   /** \brief indicates "until the end" in getSubName and compare
    */
