diff --git a/src/tlv/coordinate-lsa.cpp b/src/tlv/coordinate-lsa.cpp
index dc6919e..fc74241 100644
--- a/src/tlv/coordinate-lsa.cpp
+++ b/src/tlv/coordinate-lsa.cpp
@@ -50,21 +50,12 @@
 CoordinateLsa::wireEncode(ndn::EncodingImpl<TAG>& block) const
 {
   size_t totalLength = 0;
-  size_t doubleLength = 10;
 
-  const uint8_t* doubleBytes1;
   for (auto it = m_hyperbolicAngle.rbegin(); it != m_hyperbolicAngle.rend(); ++it) {
-    doubleBytes1 = reinterpret_cast<const uint8_t*>(&*it);
-
-    totalLength += block.prependByteArrayBlock(ndn::tlv::nlsr::Double, doubleBytes1, 8);
-    totalLength += block.prependVarNumber(doubleLength);
-    totalLength += block.prependVarNumber(ndn::tlv::nlsr::HyperbolicAngle);
+    totalLength += prependDouble(block, ndn::tlv::nlsr::HyperbolicAngle, *it);
   }
 
-  const uint8_t* doubleBytes2 = reinterpret_cast<const uint8_t*>(&m_hyperbolicRadius);
-  totalLength += block.prependByteArrayBlock(ndn::tlv::nlsr::Double, doubleBytes2, 8);
-  totalLength += block.prependVarNumber(doubleLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::HyperbolicRadius);
+  totalLength += prependDouble(block, ndn::tlv::nlsr::HyperbolicRadius, m_hyperbolicRadius);
 
   totalLength += m_lsaInfo.wireEncode(block);
 
@@ -123,17 +114,8 @@
   }
 
   if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::HyperbolicRadius) {
-    val->parse();
-    ndn::Block::element_const_iterator it = val->elements_begin();
-    if (it != val->elements_end() && it->type() == ndn::tlv::nlsr::Double) {
-      m_hyperbolicRadius = *reinterpret_cast<const double*>(it->value());
-
-      ++val;
-    }
-    else {
-      std::cout << "HyperbolicRadius: Missing required Double field" << std::endl;
-      BOOST_THROW_EXCEPTION(Error("HyperbolicRadius: Missing required Double field"));
-    }
+    m_hyperbolicRadius = ndn::tlv::nlsr::readDouble(*val);
+    ++val;
   }
   else {
     std::cout << "Missing required HyperbolicRadius field" << std::endl;
@@ -142,17 +124,7 @@
 
   for (; val != m_wire.elements_end(); ++val) {
     if (val->type() == ndn::tlv::nlsr::HyperbolicAngle) {
-      val->parse();
-
-      for (auto it = val->elements_begin(); it != val->elements_end(); ++it) {
-        if (it->type() == ndn::tlv::nlsr::Double) {
-          m_hyperbolicAngle.push_back(*reinterpret_cast<const double*>(it->value()));
-        }
-        else {
-          std::cout << "HyperbolicAngle: Missing required Double field" << std::endl;
-          BOOST_THROW_EXCEPTION(Error("HyperbolicAngle: Missing required Double field"));
-        }
-      }
+      m_hyperbolicAngle.push_back(ndn::tlv::nlsr::readDouble(*val));
     }
   }
 }
diff --git a/src/tlv/nexthop.cpp b/src/tlv/nexthop.cpp
index 342a02e..2db9c3c 100644
--- a/src/tlv/nexthop.cpp
+++ b/src/tlv/nexthop.cpp
@@ -21,6 +21,7 @@
 
 #include "nexthop.hpp"
 #include "tlv-nlsr.hpp"
+#include "coordinate-lsa.hpp"
 
 #include <ndn-cxx/util/concepts.hpp>
 #include <ndn-cxx/encoding/block-helpers.hpp>
@@ -49,8 +50,7 @@
 {
   size_t totalLength = 0;
 
-  const uint8_t* doubleBytes = reinterpret_cast<const uint8_t*>(&m_cost);
-  totalLength += block.prependByteArrayBlock(ndn::tlv::nlsr::Double, doubleBytes, 8);
+  totalLength += prependDouble(block, ndn::tlv::nlsr::Double, m_cost);
 
   totalLength += block.prependByteArrayBlock(
     ndn::tlv::nlsr::Uri, reinterpret_cast<const uint8_t*>(m_uri.c_str()), m_uri.size());
@@ -108,13 +108,7 @@
     BOOST_THROW_EXCEPTION(Error("Missing required Uri field"));
   }
 
-  if (val != val->elements_end() && val->type() == ndn::tlv::nlsr::Double) {
-    m_cost = *reinterpret_cast<const double*>(val->value());
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("HyperbolicCost: Missing required Double field"));
-  }
+  m_cost = ndn::tlv::nlsr::readDouble(*val);
 }
 
 std::ostream&
diff --git a/src/tlv/tlv-nlsr.hpp b/src/tlv/tlv-nlsr.hpp
index 3960eb0..0e400ea 100644
--- a/src/tlv/tlv-nlsr.hpp
+++ b/src/tlv/tlv-nlsr.hpp
@@ -23,6 +23,7 @@
 #define NLSR_TLV_NLSR_HPP
 
 #include <ndn-cxx/encoding/tlv.hpp>
+#include <ndn-cxx/encoding/block-helpers.hpp>
 
 namespace ndn {
 namespace tlv {
@@ -54,6 +55,45 @@
   RouteTableEntry  = 145
 };
 
+/*! \brief Read a double from a TLV element
+ *  \param block the TLV element
+ *  \throw ndn::tlv::Error block does not contain a double
+ *  \sa prependDouble
+ */
+inline double
+readDouble(const ndn::Block& block)
+{
+  block.parse();
+  auto it = block.elements_begin();
+
+  double doubleFromBlock = 0.0;
+  if (it == it->elements_end() || it->type() != ndn::tlv::nlsr::Double ||
+      it->value_size() != sizeof(doubleFromBlock)) {
+    BOOST_THROW_EXCEPTION(ndn::tlv::Error("Block does not contain a double"));
+  }
+  memcpy(&doubleFromBlock, it->value(), sizeof(doubleFromBlock));
+  return doubleFromBlock;
+}
+
+/*! \brief Prepend a TLV element containing a double.
+ *  \param encoder an EncodingBuffer or EncodingEstimator
+ *  \param type TLV-TYPE number
+ *  \param value double value
+ */
+template<ndn::encoding::Tag TAG>
+inline size_t
+prependDouble(ndn::EncodingImpl<TAG>& encoder, uint32_t type, double value)
+{
+  size_t totalLength = 0;
+
+  const uint8_t* doubleBytes = reinterpret_cast<const uint8_t*>(&value);
+  totalLength = encoder.prependByteArrayBlock(ndn::tlv::nlsr::Double, doubleBytes, 8);
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(type);
+
+  return totalLength;
+}
+
 } // namespace nlsr
 } // namespace tlv
 } // namespace ndn
