diff --git a/pkg/control/control.go b/pkg/control/control.go
index 7e2d673..d27844e 100644
--- a/pkg/control/control.go
+++ b/pkg/control/control.go
@@ -111,9 +111,10 @@
 func (c *Control) rmrSend(params *xapp.RMRParams) (err error) {
 	status := false
 	i := 1
-	rmrSendMutex.Lock()
 	for ; i <= 10 && status == false; i++ { 
+		rmrSendMutex.Lock()
 		status = xapp.Rmr.Send(params, false)
+		rmrSendMutex.Unlock()
 		if status == false {
 			xapp.Logger.Info("rmr.Send() failed. Retry count %v, Mtype: %v, SubId: %v, Xid %s",i, params.Mtype, params.SubId, params.Xid)
 			time.Sleep(500 * time.Millisecond)
@@ -123,7 +124,6 @@
 		err = errors.New("rmr.Send() failed")
 		xapp.Rmr.Free(params.Mbuf)
 	}
-	rmrSendMutex.Unlock()
 	
 	/*
 	if !xapp.Rmr.Send(params, false) {
diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index 98aa97e..03e90ae 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -24,11 +24,11 @@
 	"sync"
 )
 
-var registryMutex = &sync.Mutex{}
 
 type Registry struct {
 	register map[uint16]bool
 	counter  uint16
+	mutex sync.Mutex
 }
 
 // This method should run as a constructor
@@ -40,8 +40,8 @@
 // Reserves and returns the next free sequence number
 func (r *Registry) ReserveSequenceNumber() (uint16, bool) {
 	// Check is current SequenceNumber valid
-	registryMutex.Lock()
-	defer registryMutex.Unlock()
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
 	sequenceNumber := r.counter
 	if _, ok := r.register[sequenceNumber]; ok {
 		xapp.Logger.Error("Invalid SeqenceNumber sequenceNumber: %v",sequenceNumber)
@@ -60,8 +60,8 @@
 
 // This function checks the validity of the given subscription id
 func (r *Registry) IsValidSequenceNumber(sn uint16) bool {
-	registryMutex.Lock()
-	defer registryMutex.Unlock()
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
 	xapp.Logger.Debug("Registry map: %v", r.register)
 	if _, ok := r.register[sn]; ok {
 		return true
@@ -71,26 +71,26 @@
 
 // This function sets the give id as confirmed in the register
 func (r *Registry) setSubscriptionToConfirmed(sn uint16) {
-	registryMutex.Lock()
-	defer registryMutex.Unlock()
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
 	r.register[sn] = true
 }
 
 //This function sets the given id as unused in the register
 func (r *Registry) deleteSubscription(sn uint16) {
-	registryMutex.Lock()
-	defer registryMutex.Unlock()
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
 	r.register[sn] = false
 }
 
 //This function releases the given id as unused in the register
 func (r *Registry) releaseSequenceNumber(sn uint16) bool {
-	registryMutex.Lock()
-	defer registryMutex.Unlock()
-	if r.register[sn] {
-		return false
-		} else {
+	r.mutex.Lock()
+	defer r.mutex.Unlock()
+	if _, ok := r.register[sn]; ok {
 		delete(r.register, sn)
 		return true
+	} else {
+		return false
 	}
 }
diff --git a/pkg/control/tracker.go b/pkg/control/tracker.go
index dfab96e..9b984a3 100644
--- a/pkg/control/tracker.go
+++ b/pkg/control/tracker.go
@@ -24,13 +24,12 @@
 	"sync"
 )
 
-var trackerMutex = &sync.Mutex{}
-
 /*
 Implements a record of ongoing transactions and helper functions to CRUD the records.
 */
 type Tracker struct {
 	transactionTable map[TransactionKey]Transaction
+	mutex sync.Mutex
 }
 
 func (t *Tracker) Init() {
@@ -42,8 +41,8 @@
 Returns error if there is similar transatcion ongoing.
 */
 func (t *Tracker) TrackTransaction(key TransactionKey, xact Transaction) error {
-	trackerMutex.Lock()
-	defer trackerMutex.Unlock()
+	t.mutex.Lock()
+	defer t.mutex.Unlock()
 	if _, ok := t.transactionTable[key]; ok {
 		// TODO: Implement merge related check here. If the key is same but the value is different.
 		err := fmt.Errorf("transaction tracker: Similar transaction with sub id %d and type %s is ongoing", key.SubID, key.transType)
@@ -59,8 +58,8 @@
 */
 func (t *Tracker) UpdateTransaction(SubID uint16, transType Action, xact Transaction) error {
 	key := TransactionKey{SubID, transType}
-	trackerMutex.Lock()
-	defer trackerMutex.Unlock()
+	t.mutex.Lock()
+	defer t.mutex.Unlock()
 	if _, ok := t.transactionTable[key]; ok {
 		// TODO: Implement merge related check here. If the key is same but the value is different.
 		err := fmt.Errorf("transaction tracker: Similar transaction with sub id %d and type %v is ongoing", key.SubID, key.transType)
@@ -76,8 +75,8 @@
 */
 func (t *Tracker) RetriveTransaction(subID uint16, act Action) (Transaction, error) {
 	key := TransactionKey{subID, act}
-	trackerMutex.Lock()
-	defer trackerMutex.Unlock()
+	t.mutex.Lock()
+	defer t.mutex.Unlock()
 	var xact Transaction
 	if xact, ok := t.transactionTable[key]; ok {
 		return xact, nil
@@ -93,8 +92,8 @@
 func (t *Tracker) completeTransaction(subID uint16, act Action) (Transaction, error) {
 	key := TransactionKey{subID, act}
 	var emptyTransaction Transaction
-	trackerMutex.Lock()
-	defer trackerMutex.Unlock()
+	t.mutex.Lock()
+	defer t.mutex.Unlock()
 	if xact, ok := t.transactionTable[key]; ok {
 		delete(t.transactionTable, key)
 		return xact, nil
