diff --git a/pkg/control/control.go b/pkg/control/control.go
index b189071..52571aa 100755
--- a/pkg/control/control.go
+++ b/pkg/control/control.go
@@ -22,7 +22,6 @@
 import (
 	"fmt"
 	"gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
-	"gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/packer"
 	rtmgrclient "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client"
 	rtmgrhandle "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/handle"
 	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
@@ -135,29 +134,29 @@
 	return
 }
 
-func (c *Control) rmrSend(desc string, subs *Subscription, trans *Transaction, payload *packer.PackedData) (err error) {
+func (c *Control) rmrSend(desc string, subs *Subscription, trans *Transaction) (err error) {
 	params := &RMRParams{&xapp.RMRParams{}}
 	params.Mtype = trans.GetMtype()
 	params.SubId = int(subs.GetSubId())
 	params.Xid = ""
 	params.Meid = subs.GetMeid()
 	params.Src = ""
-	params.PayloadLen = len(payload.Buf)
-	params.Payload = payload.Buf
+	params.PayloadLen = len(trans.Payload.Buf)
+	params.Payload = trans.Payload.Buf
 	params.Mbuf = nil
 
 	return c.rmrSendRaw(desc, params)
 }
 
-func (c *Control) rmrReplyToSender(desc string, subs *Subscription, trans *Transaction, mType int, payload *packer.PackedData) (err error) {
+func (c *Control) rmrReplyToSender(desc string, subs *Subscription, trans *Transaction) (err error) {
 	params := &RMRParams{&xapp.RMRParams{}}
-	params.Mtype = mType
+	params.Mtype = trans.GetMtype()
 	params.SubId = int(subs.GetSubId())
 	params.Xid = trans.GetXid()
 	params.Meid = trans.GetMeid()
 	params.Src = ""
-	params.PayloadLen = len(payload.Buf)
-	params.Payload = payload.Buf
+	params.PayloadLen = len(trans.Payload.Buf)
+	params.Payload = trans.Payload.Buf
 	params.Mbuf = nil
 
 	return c.rmrSendRaw(desc, params)
@@ -195,7 +194,6 @@
 	//
 	//
 	trans, err := c.tracker.TrackTransaction(NewRmrEndpoint(params.Src),
-		params.Mtype,
 		params.Xid,
 		params.Meid,
 		false,
@@ -244,7 +242,7 @@
 	//
 	//       This is intermediate solution while improving message handling
 	//
-	trans.Payload, err = c.e2ap.PackSubscriptionRequest(trans.SubReqMsg)
+	trans.Mtype, trans.Payload, err = c.e2ap.PackSubscriptionRequest(trans.SubReqMsg)
 	if err != nil {
 		xapp.Logger.Error("SubReq: %s for trans %s", err.Error(), trans)
 		subs.Release()
@@ -252,7 +250,7 @@
 		return
 	}
 
-	c.rmrSend("SubReq: SubReq to E2T", subs, trans, trans.Payload)
+	c.rmrSend("SubReq: SubReq to E2T", subs, trans)
 
 	c.timerMap.StartTimer("RIC_SUB_REQ", int(subs.GetSubId()), subReqTime, FirstTry, c.handleSubscriptionRequestTimer)
 	xapp.Logger.Debug("SubReq: Debugging trans table = %v", c.tracker.transactionXappTable)
@@ -307,7 +305,7 @@
 		return
 	}
 
-	trans.Payload, err = c.e2ap.PackSubscriptionResponse(trans.SubRespMsg)
+	trans.Mtype, trans.Payload, err = c.e2ap.PackSubscriptionResponse(trans.SubRespMsg)
 	if err != nil {
 		xapp.Logger.Error("SubResp: %s for trans %s", err.Error(), trans)
 		trans.Release()
@@ -316,7 +314,7 @@
 
 	subs.Confirmed()
 	trans.Release()
-	c.rmrReplyToSender("SubResp: SubResp to xapp", subs, trans, 12011, trans.Payload)
+	c.rmrReplyToSender("SubResp: SubResp to xapp", subs, trans)
 	return
 }
 
@@ -371,9 +369,9 @@
 		return
 	}
 
-	trans.Payload, err = c.e2ap.PackSubscriptionFailure(trans.SubFailMsg)
+	trans.Mtype, trans.Payload, err = c.e2ap.PackSubscriptionFailure(trans.SubFailMsg)
 	if err == nil {
-		c.rmrReplyToSender("SubFail: SubFail to xapp", subs, trans, 12012, trans.Payload)
+		c.rmrReplyToSender("SubFail: SubFail to xapp", subs, trans)
 		time.Sleep(3 * time.Second)
 	} else {
 		//TODO error handling improvement
@@ -408,11 +406,11 @@
 	}
 
 	if tryCount < maxSubReqTryCount {
-		xapp.Logger.Info("SubReq timeout: Resending SubReq to E2T: Mtype: %v, SubId: %v, Xid %s, Meid %v", trans.GetMtype(), subs.GetSubId(), trans.GetXid(), trans.GetMeid())
+		xapp.Logger.Info("SubReq timeout: subs: %s trans: %s", subs, trans)
 
 		trans.RetryTransaction()
 
-		c.rmrSend("SubReq timeout: SubReq to E2T", subs, trans, trans.Payload)
+		c.rmrSend("SubReq timeout: SubReq to E2T", subs, trans)
 
 		tryCount++
 		c.timerMap.StartTimer("RIC_SUB_REQ", int(subs.GetSubId()), subReqTime, tryCount, c.handleSubscriptionRequestTimer)
@@ -424,7 +422,6 @@
 
 	// Create DELETE transaction (internal and no messages toward xapp)
 	deltrans, err := c.tracker.TrackTransaction(&trans.RmrEndpoint,
-		12020, // RIC SUBSCRIPTION DELETE
 		trans.GetXid(),
 		trans.GetMeid(),
 		false,
@@ -441,7 +438,7 @@
 	deltrans.SubDelReqMsg.RequestId.Id = trans.SubReqMsg.RequestId.Id
 	deltrans.SubDelReqMsg.RequestId.Seq = uint32(subs.GetSubId())
 	deltrans.SubDelReqMsg.FunctionId = trans.SubReqMsg.FunctionId
-	deltrans.Payload, err = c.e2ap.PackSubscriptionDeleteRequest(deltrans.SubDelReqMsg)
+	deltrans.Mtype, deltrans.Payload, err = c.e2ap.PackSubscriptionDeleteRequest(deltrans.SubDelReqMsg)
 	if err != nil {
 		xapp.Logger.Error("SubReq timeout: Packing SubDelReq failed. Err: %v", err)
 		//TODO improve error handling. Important at least in merge
@@ -458,7 +455,7 @@
 		return
 	}
 
-	c.rmrSend("SubReq timer: SubDelReq to E2T", subs, deltrans, deltrans.Payload)
+	c.rmrSend("SubReq timer: SubDelReq to E2T", subs, deltrans)
 	c.timerMap.StartTimer("RIC_SUB_DEL_REQ", int(subs.GetSubId()), subDelReqTime, FirstTry, c.handleSubscriptionDeleteRequestTimer)
 	return
 }
@@ -470,7 +467,6 @@
 	//
 	//
 	trans, err := c.tracker.TrackTransaction(NewRmrEndpoint(params.Src),
-		params.Mtype,
 		params.Xid,
 		params.Meid,
 		false,
@@ -521,7 +517,7 @@
 	//
 	//       This is intermediate solution while improving message handling
 	//
-	trans.Payload, err = c.e2ap.PackSubscriptionDeleteRequest(trans.SubDelReqMsg)
+	trans.Mtype, trans.Payload, err = c.e2ap.PackSubscriptionDeleteRequest(trans.SubDelReqMsg)
 	if err != nil {
 		xapp.Logger.Error("SubDelReq: %s for trans %s", err.Error(), trans)
 		trans.Release()
@@ -530,7 +526,7 @@
 
 	subs.UnConfirmed()
 
-	c.rmrSend("SubDelReq: SubDelReq to E2T", subs, trans, trans.Payload)
+	c.rmrSend("SubDelReq: SubDelReq to E2T", subs, trans)
 
 	c.timerMap.StartTimer("RIC_SUB_DEL_REQ", int(subs.GetSubId()), subDelReqTime, FirstTry, c.handleSubscriptionDeleteRequestTimer)
 	return
@@ -663,7 +659,7 @@
 	if tryCount < maxSubDelReqTryCount {
 		// Set possible to handle new response for the subId
 		trans.RetryTransaction()
-		c.rmrSend("SubDelReq timeout: SubDelReq to E2T", subs, trans, trans.Payload)
+		c.rmrSend("SubDelReq timeout: SubDelReq to E2T", subs, trans)
 		tryCount++
 		c.timerMap.StartTimer("RIC_SUB_DEL_REQ", int(subs.GetSubId()), subReqTime, tryCount, c.handleSubscriptionDeleteRequestTimer)
 		return
@@ -683,9 +679,9 @@
 		trans.SubDelRespMsg.FunctionId = trans.SubDelReqMsg.FunctionId
 
 		var err error
-		trans.Payload, err = c.e2ap.PackSubscriptionDeleteResponse(trans.SubDelRespMsg)
+		trans.Mtype, trans.Payload, err = c.e2ap.PackSubscriptionDeleteResponse(trans.SubDelRespMsg)
 		if err == nil {
-			c.rmrReplyToSender(desc+": SubDelResp to xapp", subs, trans, 12021, trans.Payload)
+			c.rmrReplyToSender(desc+": SubDelResp to xapp", subs, trans)
 			time.Sleep(3 * time.Second)
 		} else {
 			//TODO error handling improvement
