diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index 1adb4f7..2c5bd8c 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -20,87 +20,19 @@
 package control
 
 import (
+	"fmt"
 	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
-	"strconv"
 	"sync"
 )
 
 //-----------------------------------------------------------------------------
 //
 //-----------------------------------------------------------------------------
-type Subscription struct {
-	mutex  sync.Mutex
-	Seq    uint16
-	Active bool
-	//
-	Meid        *xapp.RMRMeid
-	RmrEndpoint // xapp endpoint
-	Trans       *Transaction
-}
-
-func (s *Subscription) String() string {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	return strconv.FormatUint(uint64(s.Seq), 10) + "/" + s.RmrEndpoint.String() + "/" + s.Meid.RanName
-}
-
-func (s *Subscription) Confirmed() {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	s.Active = true
-}
-
-func (s *Subscription) UnConfirmed() {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	s.Active = false
-}
-
-func (s *Subscription) IsConfirmed() bool {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	return s.Active
-}
-
-func (s *Subscription) SetTransaction(trans *Transaction) bool {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	if s.Trans == nil {
-		s.Trans = trans
-		return true
-	}
-	return false
-}
-
-func (s *Subscription) UnSetTransaction(trans *Transaction) bool {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	if trans == nil || trans == s.Trans {
-		s.Trans = nil
-		return true
-	}
-	return false
-}
-
-func (s *Subscription) GetTransaction() *Transaction {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	return s.Trans
-}
-
-func (s *Subscription) SubRouteInfo(act Action) SubRouteInfo {
-	s.mutex.Lock()
-	defer s.mutex.Unlock()
-	return SubRouteInfo{act, s.RmrEndpoint.Addr, s.RmrEndpoint.Port, s.Seq}
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
 type Registry struct {
-	register map[uint16]*Subscription
-	counter  uint16
-	mutex    sync.Mutex
+	mutex       sync.Mutex
+	register    map[uint16]*Subscription
+	counter     uint16
+	rtmgrClient *RtmgrClient
 }
 
 // This method should run as a constructor
@@ -110,7 +42,7 @@
 }
 
 // Reserves and returns the next free sequence number
-func (r *Registry) ReserveSubscription(endPoint RmrEndpoint, meid *xapp.RMRMeid) *Subscription {
+func (r *Registry) ReserveSubscription(endPoint RmrEndpoint, meid *xapp.RMRMeid) (*Subscription, error) {
 	// Check is current SequenceNumber valid
 	// Allocate next SequenceNumber value and retry N times
 	r.mutex.Lock()
@@ -125,17 +57,29 @@
 			r.counter++
 		}
 		if _, ok := r.register[sequenceNumber]; ok == false {
-			r.register[sequenceNumber] = &Subscription{
+			subs := &Subscription{
 				Seq:         sequenceNumber,
 				Active:      false,
 				RmrEndpoint: endPoint,
 				Meid:        meid,
 				Trans:       nil,
 			}
-			return r.register[sequenceNumber]
+			r.register[sequenceNumber] = subs
+
+			// Update routing
+			r.mutex.Unlock()
+			err := subs.UpdateRoute(CREATE, r.rtmgrClient)
+			r.mutex.Lock()
+			if err != nil {
+				if _, ok := r.register[sequenceNumber]; ok {
+					delete(r.register, sequenceNumber)
+				}
+				return nil, err
+			}
+			return subs, nil
 		}
 	}
-	return nil
+	return nil, fmt.Errorf("Registry: Failed to reserves subcription. RmrEndpoint: %s, Meid: %s", endPoint, meid.RanName)
 }
 
 func (r *Registry) GetSubscription(sn uint16) *Subscription {
@@ -148,14 +92,21 @@
 	return nil
 }
 
-//This function releases the given id as unused in the register
-func (r *Registry) releaseSequenceNumber(sn uint16) bool {
+func (r *Registry) DelSubscription(sn uint16) bool {
 	r.mutex.Lock()
 	defer r.mutex.Unlock()
 	if _, ok := r.register[sn]; ok {
+		subs := r.register[sn]
 		delete(r.register, sn)
+
+		// Update routing
+		r.mutex.Unlock()
+		err := subs.UpdateRoute(DELETE, r.rtmgrClient)
+		r.mutex.Lock()
+		if err != nil {
+			xapp.Logger.Error("Registry: Failed to del route. SubId: %d, RmrEndpoint: %s", subs.Seq, subs.RmrEndpoint)
+		}
 		return true
-	} else {
-		return false
 	}
+	return false
 }
