diff --git a/dmaap-mediator-producer/internal/config/config.go b/dmaap-mediator-producer/internal/config/config.go
index 9b7b1dd..dfd2505 100644
--- a/dmaap-mediator-producer/internal/config/config.go
+++ b/dmaap-mediator-producer/internal/config/config.go
@@ -28,7 +28,7 @@
 )
 
 type Config struct {
-	LogLevel               string
+	LogLevel               log.Level
 	InfoProducerHost       string
 	InfoProducerPort       int
 	InfoCoordinatorAddress string
@@ -36,15 +36,9 @@
 	MRPort                 int
 }
 
-type ProducerRegistrationInfo struct {
-	InfoProducerSupervisionCallbackUrl string   `json:"info_producer_supervision_callback_url"`
-	SupportedInfoTypes                 []string `json:"supported_info_types"`
-	InfoJobCallbackUrl                 string   `json:"info_job_callback_url"`
-}
-
 func New() *Config {
 	return &Config{
-		LogLevel:               getEnv("LOG_LEVEL", "Info"),
+		LogLevel:               getLogLevel(),
 		InfoProducerHost:       getEnv("INFO_PRODUCER_HOST", ""),
 		InfoProducerPort:       getEnvAsInt("INFO_PRODUCER_PORT", 8085),
 		InfoCoordinatorAddress: getEnv("INFO_COORD_ADDR", "http://enrichmentservice:8083"),
@@ -71,3 +65,13 @@
 
 	return defaultVal
 }
+
+func getLogLevel() log.Level {
+	logLevelStr := getEnv("LOG_LEVEL", "Info")
+	if loglevel, err := log.ParseLevel(logLevelStr); err == nil {
+		return loglevel
+	} else {
+		log.Warnf("Invalid log level: %v. Log level will be Info!", logLevelStr)
+		return log.InfoLevel
+	}
+}
diff --git a/dmaap-mediator-producer/internal/config/config_test.go b/dmaap-mediator-producer/internal/config/config_test.go
index 0fcbdd3..fc64e57 100644
--- a/dmaap-mediator-producer/internal/config/config_test.go
+++ b/dmaap-mediator-producer/internal/config/config_test.go
@@ -31,6 +31,7 @@
 )
 
 func TestNew_envVarsSetConfigContainSetValues(t *testing.T) {
+	assertions := require.New(t)
 	os.Setenv("LOG_LEVEL", "Debug")
 	os.Setenv("INFO_PRODUCER_HOST", "producerHost")
 	os.Setenv("INFO_PRODUCER_PORT", "8095")
@@ -41,16 +42,16 @@
 		os.Clearenv()
 	})
 	wantConfig := Config{
-		LogLevel:               "Debug",
+		LogLevel:               log.DebugLevel,
 		InfoProducerHost:       "producerHost",
 		InfoProducerPort:       8095,
 		InfoCoordinatorAddress: "infoCoordAddr",
 		MRHost:                 "mrHost",
 		MRPort:                 3908,
 	}
-	if got := New(); !reflect.DeepEqual(got, &wantConfig) {
-		t.Errorf("New() = %v, want %v", got, &wantConfig)
-	}
+	got := New()
+
+	assertions.Equal(&wantConfig, got)
 }
 
 func TestNew_faultyIntValueSetConfigContainDefaultValueAndWarnInLog(t *testing.T) {
@@ -64,7 +65,7 @@
 		os.Clearenv()
 	})
 	wantConfig := Config{
-		LogLevel:               "Info",
+		LogLevel:               log.InfoLevel,
 		InfoProducerHost:       "",
 		InfoProducerPort:       8085,
 		InfoCoordinatorAddress: "http://enrichmentservice:8083",
@@ -78,16 +79,29 @@
 	assertions.Contains(logString, "Invalid int value: wrong for variable: INFO_PRODUCER_PORT. Default value: 8085 will be used")
 }
 
-func TestNew_envVarsNotSetConfigContainDefaultValues(t *testing.T) {
+func TestNew_envFaultyLogLevelConfigContainDefaultValues(t *testing.T) {
+	assertions := require.New(t)
+	var buf bytes.Buffer
+	log.SetOutput(&buf)
+
+	os.Setenv("LOG_LEVEL", "wrong")
+	t.Cleanup(func() {
+		log.SetOutput(os.Stderr)
+		os.Clearenv()
+	})
+
 	wantConfig := Config{
-		LogLevel:               "Info",
+		LogLevel:               log.InfoLevel,
 		InfoProducerHost:       "",
 		InfoProducerPort:       8085,
 		InfoCoordinatorAddress: "http://enrichmentservice:8083",
 		MRHost:                 "http://message-router.onap",
 		MRPort:                 3904,
 	}
-	if got := New(); !reflect.DeepEqual(got, &wantConfig) {
-		t.Errorf("New() = %v, want %v", got, &wantConfig)
-	}
+
+	got := New()
+
+	assertions.Equal(&wantConfig, got)
+	logString := buf.String()
+	assertions.Contains(logString, "Invalid log level: wrong. Log level will be Info!")
 }
diff --git a/dmaap-mediator-producer/internal/config/registrator.go b/dmaap-mediator-producer/internal/config/registrator.go
index db46c54..83ed43f 100644
--- a/dmaap-mediator-producer/internal/config/registrator.go
+++ b/dmaap-mediator-producer/internal/config/registrator.go
@@ -27,7 +27,6 @@
 
 	log "github.com/sirupsen/logrus"
 
-	"oransc.org/nonrtric/dmaapmediatorproducer/internal/jobs"
 	"oransc.org/nonrtric/dmaapmediatorproducer/internal/restclient"
 )
 
@@ -35,25 +34,38 @@
 const registerProducerPath = "/data-producer/v1/info-producers/"
 const typeSchema = `{"type": "object","properties": {},"additionalProperties": false}`
 
+type TypeDefinition struct {
+	Id            string `json:"id"`
+	DmaapTopicURL string `json:"dmaapTopicUrl"`
+}
+
+type ProducerRegistrationInfo struct {
+	InfoProducerSupervisionCallbackUrl string   `json:"info_producer_supervision_callback_url"`
+	SupportedInfoTypes                 []string `json:"supported_info_types"`
+	InfoJobCallbackUrl                 string   `json:"info_job_callback_url"`
+}
+
 type Registrator interface {
-	RegisterTypes(types []*jobs.TypeData) error
+	RegisterTypes(types []TypeDefinition) error
 	RegisterProducer(producerId string, producerInfo *ProducerRegistrationInfo)
 }
 
 type RegistratorImpl struct {
 	infoCoordinatorAddress string
+	httpClient             restclient.HTTPClient
 }
 
-func NewRegistratorImpl(infoCoordAddr string) *RegistratorImpl {
+func NewRegistratorImpl(infoCoordAddr string, client restclient.HTTPClient) *RegistratorImpl {
 	return &RegistratorImpl{
 		infoCoordinatorAddress: infoCoordAddr,
+		httpClient:             client,
 	}
 }
 
-func (r RegistratorImpl) RegisterTypes(jobTypes []jobs.TypeData) error {
+func (r RegistratorImpl) RegisterTypes(jobTypes []TypeDefinition) error {
 	for _, jobType := range jobTypes {
 		body := fmt.Sprintf(`{"info_job_data_schema": %v}`, typeSchema)
-		if error := restclient.Put(r.infoCoordinatorAddress+registerTypePath+url.PathEscape(jobType.TypeId), []byte(body)); error != nil {
+		if error := restclient.Put(r.infoCoordinatorAddress+registerTypePath+url.PathEscape(jobType.Id), []byte(body), r.httpClient); error != nil {
 			return error
 		}
 		log.Debugf("Registered type: %v", jobType)
@@ -63,7 +75,7 @@
 
 func (r RegistratorImpl) RegisterProducer(producerId string, producerInfo *ProducerRegistrationInfo) error {
 	if body, marshalErr := json.Marshal(producerInfo); marshalErr == nil {
-		if putErr := restclient.Put(r.infoCoordinatorAddress+registerProducerPath+url.PathEscape(producerId), []byte(body)); putErr != nil {
+		if putErr := restclient.Put(r.infoCoordinatorAddress+registerProducerPath+url.PathEscape(producerId), []byte(body), r.httpClient); putErr != nil {
 			return putErr
 		}
 		log.Debugf("Registered producer: %v", producerId)
diff --git a/dmaap-mediator-producer/internal/config/registrator_test.go b/dmaap-mediator-producer/internal/config/registrator_test.go
index 353e9de..2cffa2c 100644
--- a/dmaap-mediator-producer/internal/config/registrator_test.go
+++ b/dmaap-mediator-producer/internal/config/registrator_test.go
@@ -27,28 +27,24 @@
 
 	"github.com/stretchr/testify/mock"
 	"github.com/stretchr/testify/require"
-	"oransc.org/nonrtric/dmaapmediatorproducer/internal/jobs"
-	"oransc.org/nonrtric/dmaapmediatorproducer/internal/restclient"
-	"oransc.org/nonrtric/dmaapmediatorproducer/mocks"
+	"oransc.org/nonrtric/dmaapmediatorproducer/mocks/httpclient"
 )
 
 func TestRegisterTypes(t *testing.T) {
 	assertions := require.New(t)
 
-	clientMock := mocks.HTTPClient{}
+	clientMock := httpclient.HTTPClient{}
 
 	clientMock.On("Do", mock.Anything).Return(&http.Response{
 		StatusCode: http.StatusCreated,
 	}, nil)
 
-	restclient.Client = &clientMock
-
-	type1 := jobs.TypeData{
-		TypeId: "Type1",
+	type1 := TypeDefinition{
+		Id: "Type1",
 	}
-	types := []jobs.TypeData{type1}
+	types := []TypeDefinition{type1}
 
-	r := NewRegistratorImpl("http://localhost:9990")
+	r := NewRegistratorImpl("http://localhost:9990", &clientMock)
 	err := r.RegisterTypes(types)
 
 	assertions.Nil(err)
@@ -71,21 +67,19 @@
 func TestRegisterProducer(t *testing.T) {
 	assertions := require.New(t)
 
-	clientMock := mocks.HTTPClient{}
+	clientMock := httpclient.HTTPClient{}
 
 	clientMock.On("Do", mock.Anything).Return(&http.Response{
 		StatusCode: http.StatusCreated,
 	}, nil)
 
-	restclient.Client = &clientMock
-
 	producer := ProducerRegistrationInfo{
 		InfoProducerSupervisionCallbackUrl: "supervisionCallbackUrl",
 		SupportedInfoTypes:                 []string{"type1"},
 		InfoJobCallbackUrl:                 "jobCallbackUrl",
 	}
 
-	r := NewRegistratorImpl("http://localhost:9990")
+	r := NewRegistratorImpl("http://localhost:9990", &clientMock)
 	err := r.RegisterProducer("Producer1", &producer)
 
 	assertions.Nil(err)
diff --git a/dmaap-mediator-producer/internal/jobs/jobs.go b/dmaap-mediator-producer/internal/jobs/jobs.go
index e5a1070..7b21b00 100644
--- a/dmaap-mediator-producer/internal/jobs/jobs.go
+++ b/dmaap-mediator-producer/internal/jobs/jobs.go
@@ -27,17 +27,10 @@
 	"sync"
 
 	log "github.com/sirupsen/logrus"
+	"oransc.org/nonrtric/dmaapmediatorproducer/internal/config"
 	"oransc.org/nonrtric/dmaapmediatorproducer/internal/restclient"
 )
 
-type TypeDefinitions struct {
-	Types []TypeDefinition `json:"types"`
-}
-type TypeDefinition struct {
-	Id            string `json:"id"`
-	DmaapTopicURL string `json:"dmaapTopicUrl"`
-}
-
 type TypeData struct {
 	TypeId        string `json:"id"`
 	DMaaPTopicURL string `json:"dmaapTopicUrl"`
@@ -53,33 +46,38 @@
 	InfoTypeIdentity string      `json:"info_type_identity"`
 }
 
+type JobTypeHandler interface {
+	GetTypes() ([]config.TypeDefinition, error)
+	GetSupportedTypes() []string
+}
+
 type JobHandler interface {
 	AddJob(JobInfo) error
 	DeleteJob(jobId string)
 }
 
-var (
-	mu         sync.Mutex
-	configFile = "configs/type_config.json"
-	Handler    JobHandler
-	allTypes   = make(map[string]TypeData)
-)
-
-func init() {
-	Handler = newJobHandlerImpl()
+type JobHandlerImpl struct {
+	mu               sync.Mutex
+	configFile       string
+	allTypes         map[string]TypeData
+	pollClient       restclient.HTTPClient
+	distributeClient restclient.HTTPClient
 }
 
-type jobHandlerImpl struct{}
-
-func newJobHandlerImpl() *jobHandlerImpl {
-	return &jobHandlerImpl{}
+func NewJobHandlerImpl(typeConfigFilePath string, pollClient restclient.HTTPClient, distributeClient restclient.HTTPClient) *JobHandlerImpl {
+	return &JobHandlerImpl{
+		configFile:       typeConfigFilePath,
+		allTypes:         make(map[string]TypeData),
+		pollClient:       pollClient,
+		distributeClient: distributeClient,
+	}
 }
 
-func (jh *jobHandlerImpl) AddJob(ji JobInfo) error {
-	mu.Lock()
-	defer mu.Unlock()
-	if err := validateJobInfo(ji); err == nil {
-		jobs := allTypes[ji.InfoTypeIdentity].Jobs
+func (jh *JobHandlerImpl) AddJob(ji JobInfo) error {
+	jh.mu.Lock()
+	defer jh.mu.Unlock()
+	if err := jh.validateJobInfo(ji); err == nil {
+		jobs := jh.allTypes[ji.InfoTypeIdentity].Jobs
 		jobs[ji.InfoJobIdentity] = ji
 		log.Debug("Added job: ", ji)
 		return nil
@@ -88,17 +86,17 @@
 	}
 }
 
-func (jh *jobHandlerImpl) DeleteJob(jobId string) {
-	mu.Lock()
-	defer mu.Unlock()
-	for _, typeData := range allTypes {
+func (jh *JobHandlerImpl) DeleteJob(jobId string) {
+	jh.mu.Lock()
+	defer jh.mu.Unlock()
+	for _, typeData := range jh.allTypes {
 		delete(typeData.Jobs, jobId)
 	}
 	log.Debug("Deleted job: ", jobId)
 }
 
-func validateJobInfo(ji JobInfo) error {
-	if _, ok := allTypes[ji.InfoTypeIdentity]; !ok {
+func (jh *JobHandlerImpl) validateJobInfo(ji JobInfo) error {
+	if _, ok := jh.allTypes[ji.InfoTypeIdentity]; !ok {
 		return fmt.Errorf("type not supported: %v", ji.InfoTypeIdentity)
 	}
 	if ji.InfoJobIdentity == "" {
@@ -111,86 +109,75 @@
 	return nil
 }
 
-func GetTypes() ([]TypeData, error) {
-	mu.Lock()
-	defer mu.Unlock()
-	types := make([]TypeData, 0, 1)
-	typeDefsByte, err := os.ReadFile(configFile)
+func (jh *JobHandlerImpl) GetTypes() ([]config.TypeDefinition, error) {
+	jh.mu.Lock()
+	defer jh.mu.Unlock()
+	typeDefsByte, err := os.ReadFile(jh.configFile)
 	if err != nil {
 		return nil, err
 	}
-	typeDefs := TypeDefinitions{}
+	typeDefs := struct {
+		Types []config.TypeDefinition `json:"types"`
+	}{}
 	err = json.Unmarshal(typeDefsByte, &typeDefs)
 	if err != nil {
 		return nil, err
 	}
 	for _, typeDef := range typeDefs.Types {
-		typeInfo := TypeData{
+		jh.allTypes[typeDef.Id] = TypeData{
 			TypeId:        typeDef.Id,
 			DMaaPTopicURL: typeDef.DmaapTopicURL,
 			Jobs:          make(map[string]JobInfo),
 		}
-		if _, ok := allTypes[typeInfo.TypeId]; !ok {
-			allTypes[typeInfo.TypeId] = typeInfo
-		}
-		types = append(types, typeInfo)
 	}
-	return types, nil
+	return typeDefs.Types, nil
 }
 
-func GetSupportedTypes() []string {
-	mu.Lock()
-	defer mu.Unlock()
+func (jh *JobHandlerImpl) GetSupportedTypes() []string {
+	jh.mu.Lock()
+	defer jh.mu.Unlock()
 	supportedTypes := []string{}
-	for k := range allTypes {
+	for k := range jh.allTypes {
 		supportedTypes = append(supportedTypes, k)
 	}
 	return supportedTypes
 }
 
-func AddJob(job JobInfo) error {
-	return Handler.AddJob(job)
-}
-
-func DeleteJob(jobId string) {
-	Handler.DeleteJob(jobId)
-}
-
-func RunJobs(mRAddress string) {
+func (jh *JobHandlerImpl) RunJobs(mRAddress string) {
 	for {
-		pollAndDistributeMessages(mRAddress)
+		jh.pollAndDistributeMessages(mRAddress)
 	}
 }
 
-func pollAndDistributeMessages(mRAddress string) {
-	for typeId, typeInfo := range allTypes {
+func (jh *JobHandlerImpl) pollAndDistributeMessages(mRAddress string) {
+	jh.mu.Lock()
+	defer jh.mu.Unlock()
+	for typeId, typeInfo := range jh.allTypes {
 		log.Debugf("Processing jobs for type: %v", typeId)
-		messagesBody, error := restclient.Get(fmt.Sprintf("%v/%v", mRAddress, typeInfo.DMaaPTopicURL))
+		messagesBody, error := restclient.Get(fmt.Sprintf("%v/%v", mRAddress, typeInfo.DMaaPTopicURL), jh.pollClient)
 		if error != nil {
 			log.Warnf("Error getting data from MR. Cause: %v", error)
 			continue
 		}
-		distributeMessages(messagesBody, typeInfo)
+		jh.distributeMessages(messagesBody, typeInfo)
 	}
 }
 
-func distributeMessages(messages []byte, typeInfo TypeData) {
+func (jh *JobHandlerImpl) distributeMessages(messages []byte, typeInfo TypeData) {
 	if len(messages) > 2 {
-		mu.Lock()
 		for _, jobInfo := range typeInfo.Jobs {
-			go sendMessagesToConsumer(messages, jobInfo)
+			go jh.sendMessagesToConsumer(messages, jobInfo)
 		}
-		mu.Unlock()
 	}
 }
 
-func sendMessagesToConsumer(messages []byte, jobInfo JobInfo) {
+func (jh *JobHandlerImpl) sendMessagesToConsumer(messages []byte, jobInfo JobInfo) {
 	log.Debugf("Processing job: %v", jobInfo.InfoJobIdentity)
-	if postErr := restclient.Post(jobInfo.TargetUri, messages); postErr != nil {
+	if postErr := restclient.Post(jobInfo.TargetUri, messages, jh.distributeClient); postErr != nil {
 		log.Warnf("Error posting data for job: %v. Cause: %v", jobInfo, postErr)
 	}
 }
 
-func clearAll() {
-	allTypes = make(map[string]TypeData)
+func (jh *JobHandlerImpl) clearAll() {
+	jh.allTypes = make(map[string]TypeData)
 }
diff --git a/dmaap-mediator-producer/internal/jobs/jobs_test.go b/dmaap-mediator-producer/internal/jobs/jobs_test.go
index 6f29227..b301c2f 100644
--- a/dmaap-mediator-producer/internal/jobs/jobs_test.go
+++ b/dmaap-mediator-producer/internal/jobs/jobs_test.go
@@ -31,7 +31,6 @@
 	"time"
 
 	"github.com/stretchr/testify/require"
-	"oransc.org/nonrtric/dmaapmediatorproducer/internal/restclient"
 )
 
 const typeDefinition = `{"types": [{"id": "type1", "dmaapTopicUrl": "events/unauthenticated.SEC_FAULT_OUTPUT/dmaapmediatorproducer/type1"}]}`
@@ -42,31 +41,31 @@
 	if err != nil {
 		t.Errorf("Unable to create temporary directory for types due to: %v", err)
 	}
+	fname := filepath.Join(typesDir, "type_config.json")
+	handlerUnderTest := NewJobHandlerImpl(fname, nil, nil)
 	t.Cleanup(func() {
 		os.RemoveAll(typesDir)
-		clearAll()
+		handlerUnderTest.clearAll()
 	})
-	fname := filepath.Join(typesDir, "type_config.json")
-	configFile = fname
 	if err = os.WriteFile(fname, []byte(typeDefinition), 0666); err != nil {
 		t.Errorf("Unable to create temporary config file for types due to: %v", err)
 	}
-	types, err := GetTypes()
-	wantedType := TypeData{
-		TypeId:        "type1",
-		DMaaPTopicURL: "events/unauthenticated.SEC_FAULT_OUTPUT/dmaapmediatorproducer/type1",
-		Jobs:          make(map[string]JobInfo),
+	types, err := handlerUnderTest.GetTypes()
+	wantedType := TypeDefinition{
+		Id:            "type1",
+		DmaapTopicURL: "events/unauthenticated.SEC_FAULT_OUTPUT/dmaapmediatorproducer/type1",
 	}
-	wantedTypes := []TypeData{wantedType}
+	wantedTypes := []TypeDefinition{wantedType}
 	assertions.EqualValues(wantedTypes, types)
 	assertions.Nil(err)
 
-	supportedTypes := GetSupportedTypes()
+	supportedTypes := handlerUnderTest.GetSupportedTypes()
 	assertions.EqualValues([]string{"type1"}, supportedTypes)
 }
 
 func TestAddJobWhenTypeIsSupported_shouldAddJobToAllJobsMap(t *testing.T) {
 	assertions := require.New(t)
+	handlerUnderTest := NewJobHandlerImpl("", nil, nil)
 	wantedJob := JobInfo{
 		Owner:            "owner",
 		LastUpdated:      "now",
@@ -75,66 +74,72 @@
 		InfoJobData:      "{}",
 		InfoTypeIdentity: "type1",
 	}
-	allTypes["type1"] = TypeData{
+	handlerUnderTest.allTypes["type1"] = TypeData{
 		TypeId: "type1",
 		Jobs:   map[string]JobInfo{"job1": wantedJob},
 	}
 	t.Cleanup(func() {
-		clearAll()
+		handlerUnderTest.clearAll()
 	})
 
-	err := AddJob(wantedJob)
+	err := handlerUnderTest.AddJob(wantedJob)
 	assertions.Nil(err)
-	assertions.Equal(1, len(allTypes["type1"].Jobs))
-	assertions.Equal(wantedJob, allTypes["type1"].Jobs["job1"])
+	assertions.Equal(1, len(handlerUnderTest.allTypes["type1"].Jobs))
+	assertions.Equal(wantedJob, handlerUnderTest.allTypes["type1"].Jobs["job1"])
 }
 
 func TestAddJobWhenTypeIsNotSupported_shouldReturnError(t *testing.T) {
 	assertions := require.New(t)
+	handlerUnderTest := NewJobHandlerImpl("", nil, nil)
 	jobInfo := JobInfo{
 		InfoTypeIdentity: "type1",
 	}
 
-	err := AddJob(jobInfo)
+	err := handlerUnderTest.AddJob(jobInfo)
 	assertions.NotNil(err)
 	assertions.Equal("type not supported: type1", err.Error())
 }
 
 func TestAddJobWhenJobIdMissing_shouldReturnError(t *testing.T) {
 	assertions := require.New(t)
-	allTypes["type1"] = TypeData{
+	handlerUnderTest := NewJobHandlerImpl("", nil, nil)
+	handlerUnderTest.allTypes["type1"] = TypeData{
 		TypeId: "type1",
 	}
 	t.Cleanup(func() {
-		clearAll()
+		handlerUnderTest.clearAll()
 	})
+
 	jobInfo := JobInfo{
 		InfoTypeIdentity: "type1",
 	}
-
-	err := AddJob(jobInfo)
+	err := handlerUnderTest.AddJob(jobInfo)
 	assertions.NotNil(err)
 	assertions.Equal("missing required job identity: {    <nil> type1}", err.Error())
 }
 
 func TestAddJobWhenTargetUriMissing_shouldReturnError(t *testing.T) {
 	assertions := require.New(t)
-	allTypes["type1"] = TypeData{
+	handlerUnderTest := NewJobHandlerImpl("", nil, nil)
+	handlerUnderTest.allTypes["type1"] = TypeData{
 		TypeId: "type1",
 	}
+	t.Cleanup(func() {
+		handlerUnderTest.clearAll()
+	})
+
 	jobInfo := JobInfo{
 		InfoTypeIdentity: "type1",
 		InfoJobIdentity:  "job1",
 	}
-
-	err := AddJob(jobInfo)
+	err := handlerUnderTest.AddJob(jobInfo)
 	assertions.NotNil(err)
 	assertions.Equal("missing required target URI: {  job1  <nil> type1}", err.Error())
-	clearAll()
 }
 
 func TestDeleteJob(t *testing.T) {
 	assertions := require.New(t)
+	handlerUnderTest := NewJobHandlerImpl("", nil, nil)
 	jobToKeep := JobInfo{
 		InfoJobIdentity:  "job1",
 		InfoTypeIdentity: "type1",
@@ -143,52 +148,44 @@
 		InfoJobIdentity:  "job2",
 		InfoTypeIdentity: "type1",
 	}
-	allTypes["type1"] = TypeData{
+	handlerUnderTest.allTypes["type1"] = TypeData{
 		TypeId: "type1",
 		Jobs:   map[string]JobInfo{"job1": jobToKeep, "job2": jobToDelete},
 	}
 	t.Cleanup(func() {
-		clearAll()
+		handlerUnderTest.clearAll()
 	})
 
-	DeleteJob("job2")
-	assertions.Equal(1, len(allTypes["type1"].Jobs))
-	assertions.Equal(jobToKeep, allTypes["type1"].Jobs["job1"])
+	handlerUnderTest.DeleteJob("job2")
+	assertions.Equal(1, len(handlerUnderTest.allTypes["type1"].Jobs))
+	assertions.Equal(jobToKeep, handlerUnderTest.allTypes["type1"].Jobs["job1"])
 }
 
 func TestPollAndDistributeMessages(t *testing.T) {
 	assertions := require.New(t)
-	jobInfo := JobInfo{
-		InfoTypeIdentity: "type1",
-		InfoJobIdentity:  "job1",
-		TargetUri:        "http://consumerHost/target",
-	}
-	allTypes["type1"] = TypeData{
-		TypeId:        "type1",
-		DMaaPTopicURL: "topicUrl",
-		Jobs:          map[string]JobInfo{"job1": jobInfo},
-	}
-	t.Cleanup(func() {
-		clearAll()
-	})
 
 	wg := sync.WaitGroup{}
-	wg.Add(2) // Two calls should be made to the server, one to poll and one to distribute
 	messages := `[{"message": {"data": "data"}}]`
-	clientMock := NewTestClient(func(req *http.Request) *http.Response {
+	pollClientMock := NewTestClient(func(req *http.Request) *http.Response {
 		if req.URL.String() == "http://mrAddr/topicUrl" {
 			assertions.Equal(req.Method, "GET")
-			wg.Done()
+			wg.Done() // Signal that the poll call has been made
 			return &http.Response{
 				StatusCode: 200,
 				Body:       ioutil.NopCloser(bytes.NewReader([]byte(messages))),
 				Header:     make(http.Header), // Must be set to non-nil value or it panics
 			}
-		} else if req.URL.String() == "http://consumerHost/target" {
+		}
+		t.Error("Wrong call to client: ", req)
+		t.Fail()
+		return nil
+	})
+	distributeClientMock := NewTestClient(func(req *http.Request) *http.Response {
+		if req.URL.String() == "http://consumerHost/target" {
 			assertions.Equal(req.Method, "POST")
 			assertions.Equal(messages, getBodyAsString(req))
 			assertions.Equal("application/json; charset=utf-8", req.Header.Get("Content-Type"))
-			wg.Done()
+			wg.Done() // Signal that the distribution call has been made
 			return &http.Response{
 				StatusCode: 200,
 				Body:       ioutil.NopCloser(bytes.NewBufferString(`OK`)),
@@ -199,10 +196,23 @@
 		t.Fail()
 		return nil
 	})
+	handlerUnderTest := NewJobHandlerImpl("", pollClientMock, distributeClientMock)
+	jobInfo := JobInfo{
+		InfoTypeIdentity: "type1",
+		InfoJobIdentity:  "job1",
+		TargetUri:        "http://consumerHost/target",
+	}
+	handlerUnderTest.allTypes["type1"] = TypeData{
+		TypeId:        "type1",
+		DMaaPTopicURL: "topicUrl",
+		Jobs:          map[string]JobInfo{"job1": jobInfo},
+	}
+	t.Cleanup(func() {
+		handlerUnderTest.clearAll()
+	})
 
-	restclient.Client = clientMock
-
-	pollAndDistributeMessages("http://mrAddr")
+	wg.Add(2) // Two calls should be made to the server, one to poll and one to distribute
+	handlerUnderTest.pollAndDistributeMessages("http://mrAddr")
 
 	if waitTimeout(&wg, 100*time.Millisecond) {
 		t.Error("Not all calls to server were made")
diff --git a/dmaap-mediator-producer/internal/restclient/HTTPClient.go b/dmaap-mediator-producer/internal/restclient/HTTPClient.go
index a783f7e..2b3a0cf 100644
--- a/dmaap-mediator-producer/internal/restclient/HTTPClient.go
+++ b/dmaap-mediator-producer/internal/restclient/HTTPClient.go
@@ -43,47 +43,35 @@
 	return fmt.Sprintf("Request failed due to error response with status: %v and body: %v", pe.StatusCode, string(pe.Body))
 }
 
-var (
-	Client HTTPClient
-)
-
-func init() {
-	Client = &http.Client{}
-}
-
-func Get(url string) ([]byte, error) {
-	if response, err := Client.Get(url); err == nil {
-		defer response.Body.Close()
-		if responseData, err := io.ReadAll(response.Body); err == nil {
-			if isResponseSuccess(response.StatusCode) {
+func Get(url string, client HTTPClient) ([]byte, error) {
+	if response, err := client.Get(url); err == nil {
+		if isResponseSuccess(response.StatusCode) {
+			defer response.Body.Close()
+			if responseData, err := io.ReadAll(response.Body); err == nil {
 				return responseData, nil
 			} else {
-				requestError := RequestError{
-					StatusCode: response.StatusCode,
-					Body:       responseData,
-				}
-				return nil, requestError
+				return nil, err
 			}
 		} else {
-			return nil, err
+			return nil, getRequestError(response)
 		}
 	} else {
 		return nil, err
 	}
 }
 
-func Put(url string, body []byte) error {
-	return do(http.MethodPut, url, body)
+func Put(url string, body []byte, client HTTPClient) error {
+	return do(http.MethodPut, url, body, client)
 }
 
-func Post(url string, body []byte) error {
-	return do(http.MethodPost, url, body)
+func Post(url string, body []byte, client HTTPClient) error {
+	return do(http.MethodPost, url, body, client)
 }
 
-func do(method string, url string, body []byte) error {
+func do(method string, url string, body []byte, client HTTPClient) error {
 	if req, reqErr := http.NewRequest(method, url, bytes.NewBuffer(body)); reqErr == nil {
 		req.Header.Set("Content-Type", "application/json; charset=utf-8")
-		if response, respErr := Client.Do(req); respErr == nil {
+		if response, respErr := client.Do(req); respErr == nil {
 			if isResponseSuccess(response.StatusCode) {
 				return nil
 			} else {
diff --git a/dmaap-mediator-producer/internal/restclient/HTTPClient_test.go b/dmaap-mediator-producer/internal/restclient/HTTPClient_test.go
index 3727e6a..7fe3cc7 100644
--- a/dmaap-mediator-producer/internal/restclient/HTTPClient_test.go
+++ b/dmaap-mediator-producer/internal/restclient/HTTPClient_test.go
@@ -23,58 +23,55 @@
 import (
 	"bytes"
 	"errors"
+	"fmt"
 	"io/ioutil"
 	"net/http"
-	"reflect"
 	"testing"
 
 	"github.com/stretchr/testify/mock"
 	"github.com/stretchr/testify/require"
-	"oransc.org/nonrtric/dmaapmediatorproducer/mocks"
+	"oransc.org/nonrtric/dmaapmediatorproducer/mocks/httpclient"
 )
 
-func TestGet(t *testing.T) {
-	clientMock := mocks.HTTPClient{}
-
-	clientMock.On("Get", "http://testOk").Return(&http.Response{
-		StatusCode: http.StatusOK,
-		Body:       ioutil.NopCloser(bytes.NewReader([]byte("Response"))),
-	}, nil)
-
-	clientMock.On("Get", "http://testNotOk").Return(&http.Response{
+func TestRequestError_Error(t *testing.T) {
+	assertions := require.New(t)
+	actualError := RequestError{
 		StatusCode: http.StatusBadRequest,
-		Body:       ioutil.NopCloser(bytes.NewReader([]byte("Bad Response"))),
-	}, nil)
-
-	clientMock.On("Get", "http://testError").Return(nil, errors.New("Failed Request"))
-
-	Client = &clientMock
-
+		Body:       []byte("error"),
+	}
+	assertions.Equal("Request failed due to error response with status: 400 and body: error", actualError.Error())
+}
+func TestGet(t *testing.T) {
+	assertions := require.New(t)
 	type args struct {
-		url string
+		url              string
+		mockReturnStatus int
+		mockReturnBody   string
+		mockReturnError  error
 	}
 	tests := []struct {
 		name        string
 		args        args
 		want        []byte
-		wantErr     bool
 		wantedError error
 	}{
 		{
 			name: "Test Get with OK response",
 			args: args{
-				url: "http://testOk",
+				url:              "http://testOk",
+				mockReturnStatus: http.StatusOK,
+				mockReturnBody:   "Response",
 			},
-			want:    []byte("Response"),
-			wantErr: false,
+			want: []byte("Response"),
 		},
 		{
 			name: "Test Get with Not OK response",
 			args: args{
-				url: "http://testNotOk",
+				url:              "http://testNotOk",
+				mockReturnStatus: http.StatusBadRequest,
+				mockReturnBody:   "Bad Response",
 			},
-			want:    nil,
-			wantErr: true,
+			want: nil,
 			wantedError: RequestError{
 				StatusCode: http.StatusBadRequest,
 				Body:       []byte("Bad Response"),
@@ -83,40 +80,38 @@
 		{
 			name: "Test Get with error",
 			args: args{
-				url: "http://testError",
+				url:             "http://testError",
+				mockReturnError: errors.New("Failed Request"),
 			},
 			want:        nil,
-			wantErr:     true,
 			wantedError: errors.New("Failed Request"),
 		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			got, err := Get(tt.args.url)
-			if (err != nil) != tt.wantErr {
-				t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
-				return
-			}
-			if !reflect.DeepEqual(got, tt.want) {
-				t.Errorf("Get() = %v, want %v", got, tt.want)
-			}
-			if tt.wantErr && err.Error() != tt.wantedError.Error() {
-				t.Errorf("Get() error = %v, wantedError % v", err, tt.wantedError.Error())
-			}
+			clientMock := httpclient.HTTPClient{}
+			clientMock.On("Get", tt.args.url).Return(&http.Response{
+				StatusCode: tt.args.mockReturnStatus,
+				Body:       ioutil.NopCloser(bytes.NewReader([]byte(tt.args.mockReturnBody))),
+			}, tt.args.mockReturnError)
+
+			got, err := Get(tt.args.url, &clientMock)
+			assertions.Equal(tt.wantedError, err, tt.name)
+			assertions.Equal(tt.want, got, tt.name)
+			clientMock.AssertCalled(t, "Get", tt.args.url)
 		})
 	}
 }
 
 func TestPutOk(t *testing.T) {
 	assertions := require.New(t)
-	clientMock := mocks.HTTPClient{}
+	clientMock := httpclient.HTTPClient{}
 
 	clientMock.On("Do", mock.Anything).Return(&http.Response{
 		StatusCode: http.StatusOK,
 	}, nil)
 
-	Client = &clientMock
-	if err := Put("http://localhost:9990", []byte("body")); err != nil {
+	if err := Put("http://localhost:9990", []byte("body"), &clientMock); err != nil {
 		t.Errorf("Put() error = %v, did not want error", err)
 	}
 	var actualRequest *http.Request
@@ -134,31 +129,76 @@
 	clientMock.AssertNumberOfCalls(t, "Do", 1)
 }
 
-func TestPutBadResponse(t *testing.T) {
+func TestPostOk(t *testing.T) {
 	assertions := require.New(t)
-	clientMock := mocks.HTTPClient{}
+	clientMock := httpclient.HTTPClient{}
 
 	clientMock.On("Do", mock.Anything).Return(&http.Response{
-		StatusCode: http.StatusBadRequest,
-		Body:       ioutil.NopCloser(bytes.NewReader([]byte("Bad Request"))),
+		StatusCode: http.StatusOK,
 	}, nil)
 
-	Client = &clientMock
-	err := Put("url", []byte("body"))
-	assertions.NotNil("Put() error = %v, wanted error", err)
-	expectedErrorMessage := "Request failed due to error response with status: 400 and body: Bad Request"
-	assertions.Equal(expectedErrorMessage, err.Error())
+	if err := Post("http://localhost:9990", []byte("body"), &clientMock); err != nil {
+		t.Errorf("Put() error = %v, did not want error", err)
+	}
+	var actualRequest *http.Request
+	clientMock.AssertCalled(t, "Do", mock.MatchedBy(func(req *http.Request) bool {
+		actualRequest = req
+		return true
+	}))
+	assertions.Equal(http.MethodPost, actualRequest.Method)
+	assertions.Equal("http", actualRequest.URL.Scheme)
+	assertions.Equal("localhost:9990", actualRequest.URL.Host)
+	assertions.Equal("application/json; charset=utf-8", actualRequest.Header.Get("Content-Type"))
+	body, _ := ioutil.ReadAll(actualRequest.Body)
+	expectedBody := []byte("body")
+	assertions.Equal(expectedBody, body)
+	clientMock.AssertNumberOfCalls(t, "Do", 1)
 }
 
-func TestPutError(t *testing.T) {
+func Test_doErrorCases(t *testing.T) {
 	assertions := require.New(t)
-	clientMock := mocks.HTTPClient{}
-
-	clientMock.On("Do", mock.Anything).Return(nil, errors.New("Failed Request"))
-
-	Client = &clientMock
-	err := Put("url", []byte("body"))
-	assertions.NotNil("Put() error = %v, wanted error", err)
-	expectedErrorMessage := "Failed Request"
-	assertions.Equal(expectedErrorMessage, err.Error())
+	type args struct {
+		url              string
+		mockReturnStatus int
+		mockReturnBody   []byte
+		mockReturnError  error
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr error
+	}{
+		{
+			name: "Bad request should get RequestError",
+			args: args{
+				url:              "badRequest",
+				mockReturnStatus: http.StatusBadRequest,
+				mockReturnBody:   []byte("bad request"),
+				mockReturnError:  nil,
+			},
+			wantErr: RequestError{
+				StatusCode: http.StatusBadRequest,
+				Body:       []byte("bad request"),
+			},
+		},
+		{
+			name: "Server unavailable should get error",
+			args: args{
+				url:             "serverUnavailable",
+				mockReturnError: fmt.Errorf("Server unavailable"),
+			},
+			wantErr: fmt.Errorf("Server unavailable"),
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			clientMock := httpclient.HTTPClient{}
+			clientMock.On("Do", mock.Anything).Return(&http.Response{
+				StatusCode: tt.args.mockReturnStatus,
+				Body:       ioutil.NopCloser(bytes.NewReader(tt.args.mockReturnBody)),
+			}, tt.args.mockReturnError)
+			err := do("PUT", tt.args.url, nil, &clientMock)
+			assertions.Equal(tt.wantErr, err, tt.name)
+		})
+	}
 }
diff --git a/dmaap-mediator-producer/internal/server/server.go b/dmaap-mediator-producer/internal/server/server.go
index d07b730..5861cbe 100644
--- a/dmaap-mediator-producer/internal/server/server.go
+++ b/dmaap-mediator-producer/internal/server/server.go
@@ -35,19 +35,32 @@
 const jobIdToken = "infoJobId"
 const deleteJobPath = AddJobPath + "/{" + jobIdToken + "}"
 
-func NewRouter() *mux.Router {
+type ProducerCallbackHandler struct {
+	jobHandler jobs.JobHandler
+}
+
+func NewProducerCallbackHandler(jh jobs.JobHandler) *ProducerCallbackHandler {
+	return &ProducerCallbackHandler{
+		jobHandler: jh,
+	}
+}
+
+func NewRouter(jh jobs.JobHandler) *mux.Router {
+	callbackHandler := NewProducerCallbackHandler(jh)
 	r := mux.NewRouter()
 	r.HandleFunc(StatusPath, statusHandler).Methods(http.MethodGet).Name("status")
-	r.HandleFunc(AddJobPath, addInfoJobHandler).Methods(http.MethodPost).Name("add")
-	r.HandleFunc(deleteJobPath, deleteInfoJobHandler).Methods(http.MethodDelete).Name("delete")
+	r.HandleFunc(AddJobPath, callbackHandler.addInfoJobHandler).Methods(http.MethodPost).Name("add")
+	r.HandleFunc(deleteJobPath, callbackHandler.deleteInfoJobHandler).Methods(http.MethodDelete).Name("delete")
 	r.NotFoundHandler = &notFoundHandler{}
 	r.MethodNotAllowedHandler = &methodNotAllowedHandler{}
 	return r
 }
 
-func statusHandler(w http.ResponseWriter, r *http.Request) {}
+func statusHandler(w http.ResponseWriter, r *http.Request) {
+	// Just respond OK to show the server is alive for now. Might be extended later.
+}
 
-func addInfoJobHandler(w http.ResponseWriter, r *http.Request) {
+func (h *ProducerCallbackHandler) addInfoJobHandler(w http.ResponseWriter, r *http.Request) {
 	b, readErr := ioutil.ReadAll(r.Body)
 	if readErr != nil {
 		http.Error(w, fmt.Sprintf("Unable to read body due to: %v", readErr), http.StatusBadRequest)
@@ -58,12 +71,12 @@
 		http.Error(w, fmt.Sprintf("Invalid json body. Cause: %v", unmarshalErr), http.StatusBadRequest)
 		return
 	}
-	if err := jobs.AddJob(jobInfo); err != nil {
+	if err := h.jobHandler.AddJob(jobInfo); err != nil {
 		http.Error(w, fmt.Sprintf("Invalid job info. Cause: %v", err), http.StatusBadRequest)
 	}
 }
 
-func deleteInfoJobHandler(w http.ResponseWriter, r *http.Request) {
+func (h *ProducerCallbackHandler) deleteInfoJobHandler(w http.ResponseWriter, r *http.Request) {
 	vars := mux.Vars(r)
 	id, ok := vars[jobIdToken]
 	if !ok {
@@ -71,7 +84,7 @@
 		return
 	}
 
-	jobs.DeleteJob(id)
+	h.jobHandler.DeleteJob(id)
 }
 
 type notFoundHandler struct{}
diff --git a/dmaap-mediator-producer/internal/server/server_test.go b/dmaap-mediator-producer/internal/server/server_test.go
index 5943914..0888507 100644
--- a/dmaap-mediator-producer/internal/server/server_test.go
+++ b/dmaap-mediator-producer/internal/server/server_test.go
@@ -39,7 +39,7 @@
 
 func TestNewRouter(t *testing.T) {
 	assertions := require.New(t)
-	r := NewRouter()
+	r := NewRouter(nil)
 	statusRoute := r.Get("status")
 	assertions.NotNil(statusRoute)
 	supportedMethods, err := statusRoute.GetMethods()
@@ -63,7 +63,6 @@
 	responseRecorder := httptest.NewRecorder()
 	handler.ServeHTTP(responseRecorder, newRequest("GET", "/wrong", nil, t))
 	assertions.Equal(http.StatusNotFound, responseRecorder.Code)
-
 	assertions.Contains(responseRecorder.Body.String(), "404 not found.")
 
 	methodNotAllowedHandler := r.MethodNotAllowedHandler
@@ -71,7 +70,6 @@
 	responseRecorder = httptest.NewRecorder()
 	handler.ServeHTTP(responseRecorder, newRequest(http.MethodPut, "/status", nil, t))
 	assertions.Equal(http.StatusMethodNotAllowed, responseRecorder.Code)
-
 	assertions.Contains(responseRecorder.Body.String(), "Method is not supported.")
 }
 
@@ -88,51 +86,39 @@
 
 func TestAddInfoJobHandler(t *testing.T) {
 	assertions := require.New(t)
-	jobHandlerMock := jobhandler.JobHandler{}
-
-	goodJobInfo := jobs.JobInfo{
-		Owner:            "owner",
-		LastUpdated:      "now",
-		InfoJobIdentity:  "jobId",
-		TargetUri:        "target",
-		InfoJobData:      "{}",
-		InfoTypeIdentity: "type",
-	}
-	badJobInfo := jobs.JobInfo{
-		Owner: "bad",
-	}
-	jobHandlerMock.On("AddJob", goodJobInfo).Return(nil)
-	jobHandlerMock.On("AddJob", badJobInfo).Return(errors.New("error"))
-	jobs.Handler = &jobHandlerMock
 
 	type args struct {
-		responseRecorder *httptest.ResponseRecorder
-		r                *http.Request
+		job        jobs.JobInfo
+		mockReturn error
 	}
 	tests := []struct {
 		name         string
 		args         args
 		wantedStatus int
 		wantedBody   string
-		assertFunc   assertMockFunk
 	}{
 		{
 			name: "AddInfoJobHandler with correct path and method, should return OK",
 			args: args{
-				responseRecorder: httptest.NewRecorder(),
-				r:                newRequest(http.MethodPost, "/jobs", &goodJobInfo, t),
+				job: jobs.JobInfo{
+					Owner:            "owner",
+					LastUpdated:      "now",
+					InfoJobIdentity:  "jobId",
+					TargetUri:        "target",
+					InfoJobData:      "{}",
+					InfoTypeIdentity: "type",
+				},
 			},
 			wantedStatus: http.StatusOK,
 			wantedBody:   "",
-			assertFunc: func(mock *jobhandler.JobHandler) {
-				mock.AssertCalled(t, "AddJob", goodJobInfo)
-			},
 		},
 		{
 			name: "AddInfoJobHandler with incorrect job info, should return BadRequest",
 			args: args{
-				responseRecorder: httptest.NewRecorder(),
-				r:                newRequest(http.MethodPost, "/jobs", &badJobInfo, t),
+				job: jobs.JobInfo{
+					Owner: "bad",
+				},
+				mockReturn: errors.New("error"),
 			},
 			wantedStatus: http.StatusBadRequest,
 			wantedBody:   "Invalid job info. Cause: error",
@@ -140,15 +126,19 @@
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			handler := http.HandlerFunc(addInfoJobHandler)
-			handler.ServeHTTP(tt.args.responseRecorder, tt.args.r)
-			assertions.Equal(tt.wantedStatus, tt.args.responseRecorder.Code, tt.name)
+			jobHandlerMock := jobhandler.JobHandler{}
+			jobHandlerMock.On("AddJob", tt.args.job).Return(tt.args.mockReturn)
+			callbackHandlerUnderTest := NewProducerCallbackHandler(&jobHandlerMock)
 
-			assertions.Contains(tt.args.responseRecorder.Body.String(), tt.wantedBody, tt.name)
+			handler := http.HandlerFunc(callbackHandlerUnderTest.addInfoJobHandler)
+			responseRecorder := httptest.NewRecorder()
+			r := newRequest(http.MethodPost, "/jobs", &tt.args.job, t)
 
-			if tt.assertFunc != nil {
-				tt.assertFunc(&jobHandlerMock)
-			}
+			handler.ServeHTTP(responseRecorder, r)
+
+			assertions.Equal(tt.wantedStatus, responseRecorder.Code, tt.name)
+			assertions.Contains(responseRecorder.Body.String(), tt.wantedBody, tt.name)
+			jobHandlerMock.AssertCalled(t, "AddJob", tt.args.job)
 		})
 	}
 }
@@ -158,11 +148,11 @@
 	jobHandlerMock := jobhandler.JobHandler{}
 
 	jobHandlerMock.On("DeleteJob", mock.Anything).Return(nil)
-	jobs.Handler = &jobHandlerMock
+	callbackHandlerUnderTest := NewProducerCallbackHandler(&jobHandlerMock)
 
 	responseRecorder := httptest.NewRecorder()
 	r := mux.SetURLVars(newRequest(http.MethodDelete, "/jobs/", nil, t), map[string]string{"infoJobId": "job1"})
-	handler := http.HandlerFunc(deleteInfoJobHandler)
+	handler := http.HandlerFunc(callbackHandlerUnderTest.deleteInfoJobHandler)
 	handler.ServeHTTP(responseRecorder, r)
 	assertions.Equal(http.StatusOK, responseRecorder.Result().StatusCode)
 
@@ -171,8 +161,6 @@
 	jobHandlerMock.AssertCalled(t, "DeleteJob", "job1")
 }
 
-type assertMockFunk func(mock *jobhandler.JobHandler)
-
 func newRequest(method string, url string, jobInfo *jobs.JobInfo, t *testing.T) *http.Request {
 	var body io.Reader
 	if jobInfo != nil {
diff --git a/dmaap-mediator-producer/main.go b/dmaap-mediator-producer/main.go
index 15207ec..beeb995 100644
--- a/dmaap-mediator-producer/main.go
+++ b/dmaap-mediator-producer/main.go
@@ -24,49 +24,45 @@
 	"fmt"
 	"net/http"
 	"sync"
+	"time"
 
 	log "github.com/sirupsen/logrus"
 	"oransc.org/nonrtric/dmaapmediatorproducer/internal/config"
 	"oransc.org/nonrtric/dmaapmediatorproducer/internal/jobs"
+	"oransc.org/nonrtric/dmaapmediatorproducer/internal/restclient"
 	"oransc.org/nonrtric/dmaapmediatorproducer/internal/server"
 )
 
+const timeoutHTTPClient = time.Second * 5
+const timeoutPollClient = time.Second * 15
+
 var configuration *config.Config
-var callbackAddress string
+var httpClient restclient.HTTPClient
+var jobHandler *jobs.JobHandlerImpl
 
 func init() {
 	configuration = config.New()
-	if loglevel, err := log.ParseLevel(configuration.LogLevel); err == nil {
-		log.SetLevel(loglevel)
-	} else {
-		log.Warnf("Invalid log level: %v. Log level will be Info!", configuration.LogLevel)
-	}
-
-	log.Debug("Initializing DMaaP Mediator Producer")
-	if configuration.InfoProducerHost == "" {
-		log.Fatal("Missing INFO_PRODUCER_SUPERVISION_CALLBACK_HOST")
-	}
-	callbackAddress = fmt.Sprintf("%v:%v", configuration.InfoProducerHost, configuration.InfoProducerPort)
-
-	registrator := config.NewRegistratorImpl(configuration.InfoCoordinatorAddress)
-	if types, err := jobs.GetTypes(); err == nil {
-		if regErr := registrator.RegisterTypes(types); regErr != nil {
-			log.Fatalf("Unable to register all types due to: %v", regErr)
-		}
-	} else {
-		log.Fatalf("Unable to get types to register due to: %v", err)
-	}
-	producer := config.ProducerRegistrationInfo{
-		InfoProducerSupervisionCallbackUrl: callbackAddress + server.StatusPath,
-		SupportedInfoTypes:                 jobs.GetSupportedTypes(),
-		InfoJobCallbackUrl:                 callbackAddress + server.AddJobPath,
-	}
-	if err := registrator.RegisterProducer("DMaaP_Mediator_Producer", &producer); err != nil {
-		log.Fatalf("Unable to register producer due to: %v", err)
-	}
 }
 
 func main() {
+	log.SetLevel(configuration.LogLevel)
+	log.Debug("Initializing DMaaP Mediator Producer")
+	if err := validateConfiguration(configuration); err != nil {
+		log.Fatalf("Stopping producer due to error: %v", err)
+	}
+	callbackAddress := fmt.Sprintf("%v:%v", configuration.InfoProducerHost, configuration.InfoProducerPort)
+
+	httpClient = &http.Client{
+		Timeout: timeoutHTTPClient,
+	}
+	pollClient := &http.Client{
+		Timeout: timeoutPollClient,
+	}
+	jobHandler = jobs.NewJobHandlerImpl("configs/type_config.json", pollClient, httpClient)
+	if err := registerTypesAndProducer(jobHandler, configuration.InfoCoordinatorAddress, callbackAddress); err != nil {
+		log.Fatalf("Stopping producer due to: %v", err)
+	}
+
 	log.Debug("Starting DMaaP Mediator Producer")
 	wg := new(sync.WaitGroup)
 
@@ -75,13 +71,13 @@
 
 	log.Debugf("Starting callback server at port %v", configuration.InfoProducerPort)
 	go func() {
-		r := server.NewRouter()
+		r := server.NewRouter(jobHandler)
 		log.Warn(http.ListenAndServe(fmt.Sprintf(":%v", configuration.InfoProducerPort), r))
 		wg.Done()
 	}()
 
 	go func() {
-		jobs.RunJobs(fmt.Sprintf("%v:%v", configuration.MRHost, configuration.MRPort))
+		jobHandler.RunJobs(fmt.Sprintf("%v:%v", configuration.MRHost, configuration.MRPort))
 		wg.Done()
 	}()
 
@@ -89,3 +85,30 @@
 	wg.Wait()
 	log.Debug("Stopping DMaaP Mediator Producer")
 }
+
+func validateConfiguration(configuration *config.Config) error {
+	if configuration.InfoProducerHost == "" {
+		return fmt.Errorf("missing INFO_PRODUCER_HOST")
+	}
+	return nil
+}
+
+func registerTypesAndProducer(jobHandler jobs.JobTypeHandler, infoCoordinatorAddress string, callbackAddress string) error {
+	registrator := config.NewRegistratorImpl(infoCoordinatorAddress, httpClient)
+	if types, err := jobHandler.GetTypes(); err == nil {
+		if regErr := registrator.RegisterTypes(types); regErr != nil {
+			return fmt.Errorf("unable to register all types due to: %v", regErr)
+		}
+	} else {
+		return fmt.Errorf("unable to get types to register due to: %v", err)
+	}
+	producer := config.ProducerRegistrationInfo{
+		InfoProducerSupervisionCallbackUrl: callbackAddress + server.StatusPath,
+		SupportedInfoTypes:                 jobHandler.GetSupportedTypes(),
+		InfoJobCallbackUrl:                 callbackAddress + server.AddJobPath,
+	}
+	if err := registrator.RegisterProducer("DMaaP_Mediator_Producer", &producer); err != nil {
+		return fmt.Errorf("unable to register producer due to: %v", err)
+	}
+	return nil
+}
diff --git a/dmaap-mediator-producer/mocks/HTTPClient.go b/dmaap-mediator-producer/mocks/httpclient/HTTPClient.go
similarity index 93%
rename from dmaap-mediator-producer/mocks/HTTPClient.go
rename to dmaap-mediator-producer/mocks/httpclient/HTTPClient.go
index 3037798..ab399df 100644
--- a/dmaap-mediator-producer/mocks/HTTPClient.go
+++ b/dmaap-mediator-producer/mocks/httpclient/HTTPClient.go
@@ -1,6 +1,6 @@
-// Code generated by mockery v1.0.0. DO NOT EDIT.
+// Code generated by mockery v2.9.3. DO NOT EDIT.
 
-package mocks
+package httpclient
 
 import (
 	http "net/http"
diff --git a/dmaap-mediator-producer/simulator/consumersimulator.go b/dmaap-mediator-producer/simulator/consumersimulator.go
index 144f56f..03da6f4 100644
--- a/dmaap-mediator-producer/simulator/consumersimulator.go
+++ b/dmaap-mediator-producer/simulator/consumersimulator.go
@@ -26,18 +26,25 @@
 	"fmt"
 	"io"
 	http "net/http"
+	"time"
 
 	"oransc.org/nonrtric/dmaapmediatorproducer/internal/restclient"
 )
 
+var httpClient http.Client
+
 func main() {
+	httpClient = http.Client{
+		Timeout: time.Second * 5,
+	}
 	port := flag.Int("port", 40935, "The port this consumer will listen on")
 	flag.Parse()
 	http.HandleFunc("/jobs", handleData)
 
+	registerJob(*port)
+
 	fmt.Print("Starting consumer on port: ", *port)
 	http.ListenAndServe(fmt.Sprintf(":%v", *port), nil)
-	registerJob(*port)
 }
 
 func registerJob(port int) {
@@ -49,7 +56,7 @@
 	}{fmt.Sprintf("test%v", port), fmt.Sprintf("http://localhost:%v/jobs", port), "STD_Fault_Messages", "{}"}
 	fmt.Print("Registering consumer: ", jobInfo)
 	body, _ := json.Marshal(jobInfo)
-	putErr := restclient.Put(fmt.Sprintf("http://localhost:8083/data-consumer/v1/info-jobs/job%v", port), body)
+	putErr := restclient.Put(fmt.Sprintf("http://localhost:8083/data-consumer/v1/info-jobs/job%v", port), body, &httpClient)
 	if putErr != nil {
 		fmt.Printf("Unable to register consumer: %v", putErr)
 	}
