diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index 3d70d63..1adb4f7 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -21,26 +21,82 @@
 
 import (
 	"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
@@ -54,7 +110,7 @@
 }
 
 // Reserves and returns the next free sequence number
-func (r *Registry) ReserveSubscription() *Subscription {
+func (r *Registry) ReserveSubscription(endPoint RmrEndpoint, meid *xapp.RMRMeid) *Subscription {
 	// Check is current SequenceNumber valid
 	// Allocate next SequenceNumber value and retry N times
 	r.mutex.Lock()
@@ -69,14 +125,19 @@
 			r.counter++
 		}
 		if _, ok := r.register[sequenceNumber]; ok == false {
-			r.register[sequenceNumber] = &Subscription{sequenceNumber, false}
+			r.register[sequenceNumber] = &Subscription{
+				Seq:         sequenceNumber,
+				Active:      false,
+				RmrEndpoint: endPoint,
+				Meid:        meid,
+				Trans:       nil,
+			}
 			return r.register[sequenceNumber]
 		}
 	}
 	return nil
 }
 
-// This function checks the validity of the given subscription id
 func (r *Registry) GetSubscription(sn uint16) *Subscription {
 	r.mutex.Lock()
 	defer r.mutex.Unlock()
@@ -87,31 +148,6 @@
 	return nil
 }
 
-// This function checks the validity of the given subscription id
-func (r *Registry) IsValidSequenceNumber(sn uint16) bool {
-	r.mutex.Lock()
-	defer r.mutex.Unlock()
-	xapp.Logger.Debug("Registry map: %v", r.register)
-	if _, ok := r.register[sn]; ok {
-		return true
-	}
-	return false
-}
-
-// This function sets the give id as confirmed in the register
-func (r *Registry) setSubscriptionToConfirmed(sn uint16) {
-	r.mutex.Lock()
-	defer r.mutex.Unlock()
-	r.register[sn].Confirmed()
-}
-
-//This function sets the given id as unused in the register
-func (r *Registry) setSubscriptionToUnConfirmed(sn uint16) {
-	r.mutex.Lock()
-	defer r.mutex.Unlock()
-	r.register[sn].UnConfirmed()
-}
-
 //This function releases the given id as unused in the register
 func (r *Registry) releaseSequenceNumber(sn uint16) bool {
 	r.mutex.Lock()
