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));
     }
   }
 }
