diff --git a/a1-policy-management/Dockerfile b/a1-policy-management/Dockerfile
index 52ba3fd..7c732c1 100644
--- a/a1-policy-management/Dockerfile
+++ b/a1-policy-management/Dockerfile
@@ -35,6 +35,9 @@
 WORKDIR /opt/app/policy-agent
 RUN mkdir -p /var/log/policy-agent
 RUN mkdir -p /opt/app/policy-agent/etc/cert/
+RUN mkdir -p /var/policy-management-service
+RUN chmod -R 777 /var/policy-management-service
+
 
 RUN groupadd -r onap && useradd -ms /bin/bash a1pms -g onap
 RUN chown -R a1pms:onap /var/log/policy-agent
diff --git a/a1-policy-management/api/pms-api.json b/a1-policy-management/api/pms-api.json
index 9514f7e..5b43282 100644
--- a/a1-policy-management/api/pms-api.json
+++ b/a1-policy-management/api/pms-api.json
@@ -440,11 +440,11 @@
                 "tags": ["A1 Policy Management V1.0"]
             },
             "delete": {
-                "summary": "Delete a service",
+                "summary": "Unregisters a service",
                 "operationId": "deleteService",
                 "responses": {
                     "204": {
-                        "description": "Service deleted",
+                        "description": "Service unregisterred",
                         "content": {"*/*": {"schema": {"$ref": "#/components/schemas/void"}}}
                     },
                     "404": {
diff --git a/a1-policy-management/api/pms-api.yaml b/a1-policy-management/api/pms-api.yaml
index d16fbe5..cdf91ee 100644
--- a/a1-policy-management/api/pms-api.yaml
+++ b/a1-policy-management/api/pms-api.yaml
@@ -159,7 +159,7 @@
     delete:
       tags:
       - A1 Policy Management V1.0
-      summary: Delete a service
+      summary: Unregisters a service
       operationId: deleteService
       parameters:
       - name: name
@@ -172,7 +172,7 @@
           type: string
       responses:
         204:
-          description: Service deleted
+          description: Service unregisterred
           content:
             '*/*':
               schema:
diff --git a/a1-policy-management/config/application.yaml b/a1-policy-management/config/application.yaml
index 150dca4..3294fbe 100644
--- a/a1-policy-management/config/application.yaml
+++ b/a1-policy-management/config/application.yaml
@@ -69,4 +69,6 @@
     # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s
     http.proxy-host:
     http.proxy-port: 0
+    # path where the service can store data
+    vardata-directory: /var/policy-management-service
 
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/BeanFactory.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/BeanFactory.java
index 54a5eda..4b5c2f0 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/BeanFactory.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/BeanFactory.java
@@ -25,10 +25,9 @@
 import org.apache.catalina.connector.Connector;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Rics;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Services;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
 import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
@@ -36,20 +35,14 @@
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
-class BeanFactory {
-    private final ApplicationConfig applicationConfig = new ApplicationConfig();
+public class BeanFactory {
 
     @Value("${server.http-port}")
     private int httpPort = 0;
 
     @Bean
-    public Policies getPolicies() {
-        return new Policies();
-    }
-
-    @Bean
-    public PolicyTypes getPolicyTypes() {
-        return new PolicyTypes();
+    public ApplicationConfig getApplicationConfig() {
+        return new ApplicationConfig();
     }
 
     @Bean
@@ -58,18 +51,13 @@
     }
 
     @Bean
-    public ApplicationConfig getApplicationConfig() {
-        return this.applicationConfig;
-    }
-
-    @Bean
-    Services getServices() {
+    public Services getServices() {
         return new Services();
     }
 
     @Bean
-    A1ClientFactory getA1ClientFactory() {
-        return new A1ClientFactory(this.applicationConfig);
+    public A1ClientFactory getA1ClientFactory(@Autowired ApplicationConfig applicationConfig) {
+        return new A1ClientFactory(applicationConfig);
     }
 
     @Bean
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClient.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClient.java
index 448b7b6..c3f0040 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClient.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClient.java
@@ -168,14 +168,14 @@
 
     @Override
     public Mono<String> putPolicy(Policy policy) {
-        String ricUrl =
-                getUriBuilder().createPutPolicyUri(policy.type().id(), policy.id(), policy.statusNotificationUri());
-        return post("putA1Policy", ricUrl, Optional.of(policy.json()));
+        String ricUrl = getUriBuilder().createPutPolicyUri(policy.getType().getId(), policy.getId(),
+                policy.getStatusNotificationUri());
+        return post("putA1Policy", ricUrl, Optional.of(policy.getJson()));
     }
 
     @Override
     public Mono<String> deletePolicy(Policy policy) {
-        return deletePolicyById(policy.type().id(), policy.id());
+        return deletePolicyById(policy.getType().getId(), policy.getId());
     }
 
     @Override
@@ -210,7 +210,7 @@
 
     @Override
     public Mono<String> getPolicyStatus(Policy policy) {
-        String ricUrl = getUriBuilder().createGetPolicyStatusUri(policy.type().id(), policy.id());
+        String ricUrl = getUriBuilder().createGetPolicyStatusUri(policy.getType().getId(), policy.getId());
         return post("getA1PolicyStatus", ricUrl, Optional.empty());
 
     }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/OscA1Client.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/OscA1Client.java
index 402a73b..7ded8ac 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/OscA1Client.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/OscA1Client.java
@@ -165,13 +165,14 @@
 
     @Override
     public Mono<String> putPolicy(Policy policy) {
-        String policyUri = this.uri.createPutPolicyUri(policy.type().id(), policy.id(), policy.statusNotificationUri());
-        return restClient.put(policyUri, policy.json());
+        String policyUri = this.uri.createPutPolicyUri(policy.getType().getId(), policy.getId(),
+                policy.getStatusNotificationUri());
+        return restClient.put(policyUri, policy.getJson());
     }
 
     @Override
     public Mono<String> deletePolicy(Policy policy) {
-        return deletePolicyById(policy.type().id(), policy.id());
+        return deletePolicyById(policy.getType().getId(), policy.getId());
     }
 
     @Override
@@ -188,7 +189,7 @@
 
     @Override
     public Mono<String> getPolicyStatus(Policy policy) {
-        String statusUri = uri.createGetPolicyStatusUri(policy.type().id(), policy.id());
+        String statusUri = uri.createGetPolicyStatusUri(policy.getType().getId(), policy.getId());
         return restClient.get(statusUri);
 
     }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion1.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion1.java
index ba18afe..130f550 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion1.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion1.java
@@ -113,8 +113,9 @@
 
     @Override
     public Mono<String> putPolicy(Policy policy) {
-        return restClient.put(uri.createPutPolicyUri(policy.type().id(), policy.id(), policy.statusNotificationUri()),
-                policy.json());
+        return restClient.put(
+                uri.createPutPolicyUri(policy.getType().getId(), policy.getId(), policy.getStatusNotificationUri()),
+                policy.getJson());
     }
 
     @Override
@@ -129,7 +130,7 @@
 
     @Override
     public Mono<String> deletePolicy(Policy policy) {
-        return deletePolicyById(policy.id());
+        return deletePolicyById(policy.getId());
     }
 
     @Override
@@ -146,7 +147,7 @@
 
     @Override
     public Mono<String> getPolicyStatus(Policy policy) {
-        return restClient.get(uri.createGetPolicyStatusUri(policy.type().id(), policy.id()));
+        return restClient.get(uri.createGetPolicyStatusUri(policy.getType().getId(), policy.getId()));
     }
 
     private Flux<String> getPolicyIds() {
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion2.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion2.java
index 471b3c4..d79b2e7 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion2.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/StdA1ClientVersion2.java
@@ -169,14 +169,14 @@
 
     @Override
     public Mono<String> putPolicy(Policy policy) {
-        String policyUri =
-                this.uriBuiler.createPutPolicyUri(policy.type().id(), policy.id(), policy.statusNotificationUri());
-        return restClient.put(policyUri, policy.json());
+        String policyUri = this.uriBuiler.createPutPolicyUri(policy.getType().getId(), policy.getId(),
+                policy.getStatusNotificationUri());
+        return restClient.put(policyUri, policy.getJson());
     }
 
     @Override
     public Mono<String> deletePolicy(Policy policy) {
-        return deletePolicyById(policy.type().id(), policy.id());
+        return deletePolicyById(policy.getType().getId(), policy.getId());
     }
 
     @Override
@@ -193,7 +193,7 @@
 
     @Override
     public Mono<String> getPolicyStatus(Policy policy) {
-        String statusUri = uriBuiler.createGetPolicyStatusUri(policy.type().id(), policy.id());
+        String statusUri = uriBuiler.createGetPolicyStatusUri(policy.getType().getId(), policy.getId());
         return restClient.get(statusUri);
 
     }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
index 6449e48..5bfe677 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
@@ -32,18 +32,20 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.WebClientConfig.HttpProxyConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import reactor.core.publisher.Flux;
 
 @EnableConfigurationProperties
-@ConfigurationProperties()
 public class ApplicationConfig {
     @NotEmpty
     @Getter
     @Value("${app.filepath}")
     private String localConfigurationFilePath;
 
+    @Getter
+    @Value("${app.vardata-directory:null}")
+    private String vardataDirectory;
+
     @Value("${server.ssl.key-store-type}")
     private String sslKeyStoreType = "";
 
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/PolicyController.java
index 1f5f7ca..c2f6a48 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/PolicyController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/PolicyController.java
@@ -44,7 +44,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.controllers.VoidResponse;
 import org.onap.ccsdk.oran.a1policymanagementservice.controllers.v2.ErrorResponse;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.EntityNotFoundException;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Lock.LockType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
@@ -135,7 +134,7 @@
                     description = "The identity of the policy type to get the definition for.") //
             @RequestParam(name = "id", required = true) String id) throws EntityNotFoundException {
         PolicyType type = policyTypes.getType(id);
-        return new ResponseEntity<>(type.schema(), HttpStatus.OK);
+        return new ResponseEntity<>(type.getSchema(), HttpStatus.OK);
     }
 
     @GetMapping("/policy_types")
@@ -175,7 +174,7 @@
             @Parameter(name = "id", required = true, description = "The identity of the policy instance.") //
             @RequestParam(name = "id", required = true) String id) throws EntityNotFoundException {
         Policy p = policies.getPolicy(id);
-        return new ResponseEntity<>(p.json(), HttpStatus.OK);
+        return new ResponseEntity<>(p.getJson(), HttpStatus.OK);
     }
 
     @DeleteMapping("/policy")
@@ -197,11 +196,11 @@
             @Parameter(name = "id", required = true, description = "The identity of the policy instance.") //
             @RequestParam(name = "id", required = true) String id) throws EntityNotFoundException {
         Policy policy = policies.getPolicy(id);
-        keepServiceAlive(policy.ownerServiceId());
-        Ric ric = policy.ric();
+        keepServiceAlive(policy.getOwnerServiceId());
+        Ric ric = policy.getRic();
         return ric.getLock().lock(LockType.SHARED) //
                 .flatMap(notUsed -> assertRicStateIdle(ric)) //
-                .flatMap(notUsed -> a1ClientFactory.createA1Client(policy.ric())) //
+                .flatMap(notUsed -> a1ClientFactory.createA1Client(policy.getRic())) //
                 .doOnNext(notUsed -> policies.remove(policy)) //
                 .flatMap(client -> client.deletePolicy(policy)) //
                 .doOnNext(notUsed -> ric.getLock().unlockBlocking()) //
@@ -252,7 +251,7 @@
         if (ric == null || type == null) {
             return Mono.just(new ResponseEntity<>(HttpStatus.NOT_FOUND));
         }
-        Policy policy = ImmutablePolicy.builder() //
+        Policy policy = Policy.builder() //
                 .id(instanceId) //
                 .json(jsonString) //
                 .type(type) //
@@ -263,7 +262,7 @@
                 .statusNotificationUri("") //
                 .build();
 
-        final boolean isCreate = this.policies.get(policy.id()) == null;
+        final boolean isCreate = this.policies.get(policy.getId()) == null;
 
         return ric.getLock().lock(LockType.SHARED) //
                 .flatMap(notUsed -> assertRicStateIdle(ric)) //
@@ -298,11 +297,11 @@
 
     private Mono<Object> validateModifiedPolicy(Policy policy) {
         // Check that ric is not updated
-        Policy current = this.policies.get(policy.id());
-        if (current != null && !current.ric().id().equals(policy.ric().id())) {
-            RejectionException e = new RejectionException("Policy cannot change RIC, policyId: " + current.id() + //
-                    ", RIC name: " + current.ric().id() + //
-                    ", new name: " + policy.ric().id(), HttpStatus.CONFLICT);
+        Policy current = this.policies.get(policy.getId());
+        if (current != null && !current.getRic().id().equals(policy.getRic().id())) {
+            RejectionException e = new RejectionException("Policy cannot change RIC, policyId: " + current.getId() + //
+                    ", RIC name: " + current.getRic().id() + //
+                    ", new name: " + policy.getRic().id(), HttpStatus.CONFLICT);
             logger.debug("Request rejected, {}", e.getMessage());
             return Mono.error(e);
         }
@@ -310,10 +309,10 @@
     }
 
     private Mono<Object> checkSupportedType(Ric ric, PolicyType type) {
-        if (!ric.isSupportingType(type.id())) {
+        if (!ric.isSupportingType(type.getId())) {
             logger.debug("Request rejected, type not supported, RIC: {}", ric);
-            RejectionException e = new RejectionException("Type: " + type.id() + " not supported by RIC: " + ric.id(),
-                    HttpStatus.NOT_FOUND);
+            RejectionException e = new RejectionException(
+                    "Type: " + type.getId() + " not supported by RIC: " + ric.id(), HttpStatus.NOT_FOUND);
             return Mono.error(e);
         }
         return Mono.just("OK");
@@ -405,7 +404,7 @@
             throws EntityNotFoundException {
         Policy policy = policies.getPolicy(id);
 
-        return a1ClientFactory.createA1Client(policy.ric()) //
+        return a1ClientFactory.createA1Client(policy.getRic()) //
                 .flatMap(client -> client.getPolicyStatus(policy)) //
                 .flatMap(status -> Mono.just(new ResponseEntity<>(status, HttpStatus.OK)))
                 .onErrorResume(this::handleException);
@@ -428,7 +427,8 @@
         }
         List<Policy> filtered = new ArrayList<>();
         for (Policy p : collection) {
-            if (include(type, p.type().id()) && include(ric, p.ric().id()) && include(service, p.ownerServiceId())) {
+            if (include(type, p.getType().getId()) && include(ric, p.getRic().id())
+                    && include(service, p.getOwnerServiceId())) {
                 filtered.add(p);
             }
         }
@@ -451,12 +451,12 @@
         List<PolicyInfo> v = new ArrayList<>(policies.size());
         for (Policy p : policies) {
             PolicyInfo policyInfo = new PolicyInfo();
-            policyInfo.id = p.id();
-            policyInfo.json = fromJson(p.json());
-            policyInfo.ric = p.ric().id();
-            policyInfo.type = p.type().id();
-            policyInfo.service = p.ownerServiceId();
-            policyInfo.lastModified = p.lastModified().toString();
+            policyInfo.id = p.getId();
+            policyInfo.json = fromJson(p.getJson());
+            policyInfo.ric = p.getRic().id();
+            policyInfo.type = p.getType().getId();
+            policyInfo.service = p.getOwnerServiceId();
+            policyInfo.lastModified = p.getLastModified().toString();
             if (!policyInfo.validate()) {
                 logger.error("BUG, all fields must be set");
             }
@@ -478,7 +478,7 @@
                 result.append(",");
             }
             first = false;
-            result.append(t.schema());
+            result.append(t.getSchema());
         }
         result.append("]");
         return result.toString();
@@ -487,7 +487,7 @@
     private String toPolicyTypeIdsJson(Collection<PolicyType> types) {
         List<String> v = new ArrayList<>(types.size());
         for (PolicyType t : types) {
-            v.add(t.id());
+            v.add(t.getId());
         }
         return gson.toJson(v);
     }
@@ -495,7 +495,7 @@
     private String toPolicyIdsJson(Collection<Policy> policies) {
         List<String> v = new ArrayList<>(policies.size());
         for (Policy p : policies) {
-            v.add(p.id());
+            v.add(p.getId());
         }
         return gson.toJson(v);
     }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ServiceController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ServiceController.java
index b4b7dca..4e42550 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ServiceController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ServiceController.java
@@ -141,12 +141,11 @@
         }
     }
 
-    @Operation(summary = "Delete a service")
+    @Operation(summary = "Unregisters a service")
     @ApiResponses(value = { //
-            @ApiResponse(responseCode = "204", description = "Service deleted"),
-            @ApiResponse(responseCode = "204", description = "Not used",
+            @ApiResponse(responseCode = "204", description = "Service unregisterred", //
                     content = @Content(schema = @Schema(implementation = VoidResponse.class))),
-            @ApiResponse(responseCode = "404", description = "Service not found",
+            @ApiResponse(responseCode = "404", description = "Service not found", //
                     content = @Content(schema = @Schema(implementation = String.class)))})
     @DeleteMapping("/services")
     public ResponseEntity<String> deleteService(//
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
index 1f0e160..ab9b669 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
@@ -42,7 +42,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.controllers.VoidResponse;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.EntityNotFoundException;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Lock.LockType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
@@ -115,7 +114,7 @@
     public ResponseEntity<Object> getPolicyType( //
             @PathVariable("policytype_id") String policyTypeId) throws EntityNotFoundException {
         PolicyType type = policyTypes.getType(policyTypeId);
-        PolicyTypeInfo info = new PolicyTypeInfo(type.schema());
+        PolicyTypeInfo info = new PolicyTypeInfo(type.getSchema());
         return new ResponseEntity<>(gson.toJson(info), HttpStatus.OK);
     }
 
@@ -177,12 +176,12 @@
     public Mono<ResponseEntity<Object>> deletePolicy( //
             @PathVariable(Consts.POLICY_ID_PARAM) String policyId) throws EntityNotFoundException {
         Policy policy = policies.getPolicy(policyId);
-        keepServiceAlive(policy.ownerServiceId());
-        Ric ric = policy.ric();
+        keepServiceAlive(policy.getOwnerServiceId());
+        Ric ric = policy.getRic();
 
         return ric.getLock().lock(LockType.SHARED) //
                 .flatMap(notUsed -> assertRicStateIdle(ric)) //
-                .flatMap(notUsed -> a1ClientFactory.createA1Client(policy.ric())) //
+                .flatMap(notUsed -> a1ClientFactory.createA1Client(policy.getRic())) //
                 .doOnNext(notUsed -> policies.remove(policy)) //
                 .flatMap(client -> client.deletePolicy(policy)) //
                 .doOnNext(notUsed -> ric.getLock().unlockBlocking()) //
@@ -219,7 +218,7 @@
         if (ric == null || type == null) {
             throw new EntityNotFoundException("Near-RT RIC or policy type not found");
         }
-        Policy policy = ImmutablePolicy.builder() //
+        Policy policy = Policy.builder() //
                 .id(policyInfo.policyId) //
                 .json(jsonString) //
                 .type(type) //
@@ -230,7 +229,7 @@
                 .statusNotificationUri(policyInfo.statusNotificationUri == null ? "" : policyInfo.statusNotificationUri) //
                 .build();
 
-        final boolean isCreate = this.policies.get(policy.id()) == null;
+        final boolean isCreate = this.policies.get(policy.getId()) == null;
 
         return ric.getLock().lock(LockType.SHARED) //
                 .flatMap(notUsed -> assertRicStateIdle(ric)) //
@@ -259,11 +258,11 @@
 
     private Mono<Object> validateModifiedPolicy(Policy policy) {
         // Check that ric is not updated
-        Policy current = this.policies.get(policy.id());
-        if (current != null && !current.ric().id().equals(policy.ric().id())) {
-            RejectionException e = new RejectionException("Policy cannot change RIC, policyId: " + current.id() + //
-                    ", RIC ID: " + current.ric().id() + //
-                    ", new ID: " + policy.ric().id(), HttpStatus.CONFLICT);
+        Policy current = this.policies.get(policy.getId());
+        if (current != null && !current.getRic().id().equals(policy.getRic().id())) {
+            RejectionException e = new RejectionException("Policy cannot change RIC, policyId: " + current.getId() + //
+                    ", RIC ID: " + current.getRic().id() + //
+                    ", new ID: " + policy.getRic().id(), HttpStatus.CONFLICT);
             logger.debug("Request rejected, {}", e.getMessage());
             return Mono.error(e);
         }
@@ -271,10 +270,10 @@
     }
 
     private Mono<Object> checkSupportedType(Ric ric, PolicyType type) {
-        if (!ric.isSupportingType(type.id())) {
+        if (!ric.isSupportingType(type.getId())) {
             logger.debug("Request rejected, type not supported, RIC: {}", ric);
-            RejectionException e = new RejectionException("Type: " + type.id() + " not supported by RIC: " + ric.id(),
-                    HttpStatus.NOT_FOUND);
+            RejectionException e = new RejectionException(
+                    "Type: " + type.getId() + " not supported by RIC: " + ric.id(), HttpStatus.NOT_FOUND);
             return Mono.error(e);
         }
         return Mono.just("{}");
@@ -376,7 +375,7 @@
             @PathVariable(Consts.POLICY_ID_PARAM) String policyId) throws EntityNotFoundException {
         Policy policy = policies.getPolicy(policyId);
 
-        return a1ClientFactory.createA1Client(policy.ric()) //
+        return a1ClientFactory.createA1Client(policy.getRic()) //
                 .flatMap(client -> client.getPolicyStatus(policy).onErrorResume(e -> Mono.just("{}"))) //
                 .flatMap(status -> createPolicyStatus(policy, status)) //
                 .onErrorResume(this::handleException);
@@ -384,7 +383,7 @@
     }
 
     private Mono<ResponseEntity<Object>> createPolicyStatus(Policy policy, String statusFromNearRic) {
-        PolicyStatusInfo info = new PolicyStatusInfo(policy.lastModified(), fromJson(statusFromNearRic));
+        PolicyStatusInfo info = new PolicyStatusInfo(policy.getLastModified(), fromJson(statusFromNearRic));
         String str = gson.toJson(info);
         return Mono.just(new ResponseEntity<>(str, HttpStatus.OK));
     }
@@ -406,7 +405,8 @@
         }
         List<Policy> filtered = new ArrayList<>();
         for (Policy p : collection) {
-            if (include(type, p.type().id()) && include(ric, p.ric().id()) && include(service, p.ownerServiceId())) {
+            if (include(type, p.getType().getId()) && include(ric, p.getRic().id())
+                    && include(service, p.getOwnerServiceId())) {
                 filtered.add(p);
             }
         }
@@ -427,14 +427,14 @@
 
     private PolicyInfo toPolicyInfo(Policy p) {
         PolicyInfo policyInfo = new PolicyInfo();
-        policyInfo.policyId = p.id();
-        policyInfo.policyData = fromJson(p.json());
-        policyInfo.ricId = p.ric().id();
-        policyInfo.policyTypeId = p.type().id();
-        policyInfo.serviceId = p.ownerServiceId();
+        policyInfo.policyId = p.getId();
+        policyInfo.policyData = fromJson(p.getJson());
+        policyInfo.ricId = p.getRic().id();
+        policyInfo.policyTypeId = p.getType().getId();
+        policyInfo.serviceId = p.getOwnerServiceId();
         policyInfo.isTransient = p.isTransient();
-        if (!p.statusNotificationUri().isEmpty()) {
-            policyInfo.statusNotificationUri = p.statusNotificationUri();
+        if (!p.getStatusNotificationUri().isEmpty()) {
+            policyInfo.statusNotificationUri = p.getStatusNotificationUri();
         }
         if (!policyInfo.validate()) {
             logger.error("BUG, all mandatory fields must be set");
@@ -459,7 +459,7 @@
     private String toPolicyTypeIdsJson(Collection<PolicyType> types) {
         List<String> v = new ArrayList<>(types.size());
         for (PolicyType t : types) {
-            v.add(t.id());
+            v.add(t.getId());
         }
         PolicyTypeIdList ids = new PolicyTypeIdList(v);
         return gson.toJson(ids);
@@ -468,7 +468,7 @@
     private String toPolicyIdsJson(Collection<Policy> policies) {
         List<String> v = new ArrayList<>(policies.size());
         for (Policy p : policies) {
-            v.add(p.id());
+            v.add(p.getId());
         }
         return gson.toJson(new PolicyIdList(v));
     }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java
index d3ff999..a110619 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java
@@ -150,17 +150,16 @@
         }
     }
 
+    @DeleteMapping(Consts.V2_API_ROOT + "/services/{service_id:.+}")
     @Operation(summary = "Unregister a service")
     @ApiResponses(value = { //
             @ApiResponse(responseCode = "204", description = "Service unregistered"),
-            @ApiResponse(responseCode = "200", description = "Not used",
+            @ApiResponse(responseCode = "200", description = "Not used", //
                     content = @Content(schema = @Schema(implementation = VoidResponse.class))),
-            @ApiResponse(responseCode = "404", description = "Service not found",
+            @ApiResponse(responseCode = "404", description = "Service not found", //
                     content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class)))
 
     })
-
-    @DeleteMapping(Consts.V2_API_ROOT + "/services/{service_id:.+}")
     public ResponseEntity<Object> deleteService(//
             @PathVariable("service_id") String serviceId) {
         try {
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumer.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumer.java
index 5676523..bc67e66 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumer.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumer.java
@@ -25,13 +25,10 @@
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonParser;
-import com.google.gson.TypeAdapterFactory;
 
 import java.time.Duration;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Optional;
-import java.util.ServiceLoader;
 
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClient;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClientFactory;
@@ -115,7 +112,6 @@
     public DmaapMessageConsumer(ApplicationConfig applicationConfig) {
         this.applicationConfig = applicationConfig;
         GsonBuilder gsonBuilder = new GsonBuilder();
-        ServiceLoader.load(TypeAdapterFactory.class).forEach(gsonBuilder::registerTypeAdapterFactory);
         this.gson = gsonBuilder.create();
         this.restClientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig());
     }
@@ -199,12 +195,12 @@
 
     protected Mono<String> sendErrorResponse(String response) {
         logger.debug("sendErrorResponse {}", response);
-        DmaapRequestMessage fakeRequest = ImmutableDmaapRequestMessage.builder() //
+        DmaapRequestMessage fakeRequest = DmaapRequestMessage.builder() //
                 .apiVersion("") //
                 .correlationId("") //
                 .operation(DmaapRequestMessage.Operation.PUT) //
                 .originatorId("") //
-                .payload(Optional.empty()) //
+                .payload(null) //
                 .requestId("") //
                 .target("") //
                 .timestamp("") //
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandler.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandler.java
index c77087a..d035417 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandler.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandler.java
@@ -24,8 +24,6 @@
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonObject;
 
-import java.util.Optional;
-
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClient;
 import org.onap.ccsdk.oran.a1policymanagementservice.dmaap.DmaapRequestMessage.Operation;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
@@ -89,8 +87,8 @@
     }
 
     private Mono<ResponseEntity<String>> invokePolicyManagementService(DmaapRequestMessage dmaapRequestMessage) {
-        DmaapRequestMessage.Operation operation = dmaapRequestMessage.operation();
-        String uri = dmaapRequestMessage.url();
+        DmaapRequestMessage.Operation operation = dmaapRequestMessage.getOperation();
+        String uri = dmaapRequestMessage.getUrl();
 
         if (operation == Operation.DELETE) {
             return pmsClient.deleteForEntity(uri);
@@ -106,9 +104,9 @@
     }
 
     private String payload(DmaapRequestMessage message) {
-        Optional<JsonObject> payload = message.payload();
-        if (payload.isPresent()) {
-            return gson.toJson(payload.get());
+        JsonObject payload = message.getPayload();
+        if (payload != null) {
+            return gson.toJson(payload);
         } else {
             logger.warn("Expected payload in message from DMAAP: {}", message);
             return "";
@@ -127,14 +125,16 @@
 
     private Mono<String> createDmaapResponseMessage(DmaapRequestMessage dmaapRequestMessage, String response,
             HttpStatus status) {
-        DmaapResponseMessage dmaapResponseMessage = ImmutableDmaapResponseMessage.builder() //
+        DmaapResponseMessage dmaapResponseMessage = DmaapResponseMessage.builder() //
                 .status(status.toString()) //
                 .message(response == null ? "" : response) //
                 .type("response") //
-                .correlationId(dmaapRequestMessage.correlationId() == null ? "" : dmaapRequestMessage.correlationId()) //
-                .originatorId(dmaapRequestMessage.originatorId() == null ? "" : dmaapRequestMessage.originatorId()) //
-                .requestId(dmaapRequestMessage.requestId() == null ? "" : dmaapRequestMessage.requestId()) //
-                .timestamp(dmaapRequestMessage.timestamp() == null ? "" : dmaapRequestMessage.timestamp()) //
+                .correlationId(
+                        dmaapRequestMessage.getCorrelationId() == null ? "" : dmaapRequestMessage.getCorrelationId()) //
+                .originatorId(
+                        dmaapRequestMessage.getOriginatorId() == null ? "" : dmaapRequestMessage.getOriginatorId()) //
+                .requestId(dmaapRequestMessage.getRequestId() == null ? "" : dmaapRequestMessage.getRequestId()) //
+                .timestamp(dmaapRequestMessage.getTimestamp() == null ? "" : dmaapRequestMessage.getTimestamp()) //
                 .build();
         String str = gson.toJson(dmaapResponseMessage);
         return Mono.just(str);
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapRequestMessage.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapRequestMessage.java
index f41c51c..10dc981 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapRequestMessage.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapRequestMessage.java
@@ -22,34 +22,34 @@
 
 import com.google.gson.JsonObject;
 
-import java.util.Optional;
+import lombok.Builder;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
 
-import org.immutables.gson.Gson;
-import org.immutables.value.Value;
-
-@Value.Immutable
-@Gson.TypeAdapters
-public interface DmaapRequestMessage {
+@Getter
+@Builder
+@EqualsAndHashCode
+public class DmaapRequestMessage {
 
     public enum Operation {
         PUT, GET, DELETE, POST
     }
 
-    String correlationId();
+    String correlationId;
 
-    String target();
+    String target;
 
-    String timestamp();
+    String timestamp;
 
-    String apiVersion();
+    String apiVersion;
 
-    String originatorId();
+    String originatorId;
 
-    String requestId();
+    String requestId;
 
-    Operation operation();
+    Operation operation;
 
-    String url();
+    String url;
 
-    Optional<JsonObject> payload();
+    JsonObject payload;
 }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapResponseMessage.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapResponseMessage.java
index 0402474..6477855 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapResponseMessage.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapResponseMessage.java
@@ -20,24 +20,26 @@
 
 package org.onap.ccsdk.oran.a1policymanagementservice.dmaap;
 
-import org.immutables.gson.Gson;
-import org.immutables.value.Value;
+import lombok.Builder;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
 
-@Value.Immutable
-@Gson.TypeAdapters
-public interface DmaapResponseMessage {
+@Getter
+@Builder
+@EqualsAndHashCode
+public class DmaapResponseMessage {
 
-    String type();
+    String type;
 
-    String correlationId();
+    String correlationId;
 
-    String timestamp();
+    String timestamp;
 
-    String originatorId();
+    String originatorId;
 
-    String requestId();
+    String requestId;
 
-    String status();
+    String status;
 
-    String message();
+    String message;
 }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/MultiMap.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/MultiMap.java
new file mode 100644
index 0000000..ff09ba3
--- /dev/null
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/MultiMap.java
@@ -0,0 +1,65 @@
+/*-
+ * ========================LICENSE_START=================================
+ * ONAP : ccsdk oran
+ * ======================================================================
+ * Copyright (C) 2019-2020 Nordix Foundation. All rights reserved.
+ * ======================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+
+package org.onap.ccsdk.oran.a1policymanagementservice.repository;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
+
+/**
+ * A map, where each key can be bound to may values (where each value has an own
+ * ID)
+ */
+public class MultiMap<T> {
+
+    private final Map<String, Map<String, T>> map = new HashMap<>();
+
+    public void put(String key, String id, T value) {
+        this.map.computeIfAbsent(key, k -> new HashMap<>()).put(id, value);
+    }
+
+    public T remove(String key, String id) {
+        Map<String, T> innerMap = this.map.get(key);
+        if (innerMap != null) {
+            T removedElement = innerMap.remove(id);
+            if (innerMap.isEmpty()) {
+                this.map.remove(key);
+            }
+            return removedElement;
+        }
+        return null;
+    }
+
+    public Collection<T> get(String key) {
+        Map<String, T> innerMap = this.map.get(key);
+        if (innerMap == null) {
+            return Collections.emptyList();
+        }
+        return new Vector<>(innerMap.values());
+    }
+
+    public void clear() {
+        this.map.clear();
+    }
+
+}
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policies.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policies.java
index 882d336..a24c5bd 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policies.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policies.java
@@ -20,50 +20,74 @@
 
 package org.onap.ccsdk.oran.a1policymanagementservice.repository;
 
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.invoke.MethodHandles;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.time.Instant;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import java.util.Vector;
 
-import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.EntityNotFoundException;
+import lombok.Builder;
+import lombok.Getter;
 
+import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
+import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.EntityNotFoundException;
+import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.FileSystemUtils;
+
+@Configuration
 public class Policies {
+
+    @Getter
+    @Builder
+    private static class PersistentPolicyInfo {
+        private String id;
+        private String json;
+        private String ownerServiceId;
+        private String ricId;
+        private String typeId;
+        private String statusNotificationUri;
+        private boolean isTransient;
+        private String lastModified;
+    }
+
+    private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
     private Map<String, Policy> policiesId = new HashMap<>();
-    private Map<String, Map<String, Policy>> policiesRic = new HashMap<>();
-    private Map<String, Map<String, Policy>> policiesService = new HashMap<>();
-    private Map<String, Map<String, Policy>> policiesType = new HashMap<>();
+    private MultiMap<Policy> policiesRic = new MultiMap<>();
+    private MultiMap<Policy> policiesService = new MultiMap<>();
+    private MultiMap<Policy> policiesType = new MultiMap<>();
+
+    private final ApplicationConfig appConfig;
+    private static Gson gson = new GsonBuilder().create();
+
+    public Policies(@Autowired ApplicationConfig appConfig) {
+        this.appConfig = appConfig;
+    }
 
     public synchronized void put(Policy policy) {
-        policiesId.put(policy.id(), policy);
-        multiMapPut(policiesRic, policy.ric().id(), policy);
-        multiMapPut(policiesService, policy.ownerServiceId(), policy);
-        multiMapPut(policiesType, policy.type().id(), policy);
-    }
-
-    private void multiMapPut(Map<String, Map<String, Policy>> multiMap, String key, Policy value) {
-        multiMap.computeIfAbsent(key, k -> new HashMap<>()).put(value.id(), value);
-    }
-
-    private void multiMapRemove(Map<String, Map<String, Policy>> multiMap, String key, Policy value) {
-        Map<String, Policy> map = multiMap.get(key);
-        if (map != null) {
-            map.remove(value.id());
-            if (map.isEmpty()) {
-                multiMap.remove(key);
-            }
+        policiesId.put(policy.getId(), policy);
+        policiesRic.put(policy.getRic().id(), policy.getId(), policy);
+        policiesService.put(policy.getOwnerServiceId(), policy.getId(), policy);
+        policiesType.put(policy.getType().getId(), policy.getId(), policy);
+        if (this.appConfig.getVardataDirectory() != null && !policy.isTransient()) {
+            store(policy);
         }
     }
 
-    private Collection<Policy> multiMapGet(Map<String, Map<String, Policy>> multiMap, String key) {
-        Map<String, Policy> map = multiMap.get(key);
-        if (map == null) {
-            return Collections.emptyList();
-        }
-        return new Vector<>(map.values());
-    }
-
     public synchronized boolean containsPolicy(String id) {
         return policiesId.containsKey(id);
     }
@@ -85,15 +109,15 @@
     }
 
     public synchronized Collection<Policy> getForService(String service) {
-        return multiMapGet(policiesService, service);
+        return policiesService.get(service);
     }
 
     public synchronized Collection<Policy> getForRic(String ric) {
-        return multiMapGet(policiesRic, ric);
+        return policiesRic.get(ric);
     }
 
     public synchronized Collection<Policy> getForType(String type) {
-        return multiMapGet(policiesType, type);
+        return policiesType.get(type);
     }
 
     public synchronized Policy removeId(String id) {
@@ -105,10 +129,17 @@
     }
 
     public synchronized void remove(Policy policy) {
-        policiesId.remove(policy.id());
-        multiMapRemove(policiesRic, policy.ric().id(), policy);
-        multiMapRemove(policiesService, policy.ownerServiceId(), policy);
-        multiMapRemove(policiesType, policy.type().id(), policy);
+        if (!policy.isTransient()) {
+            try {
+                Files.delete(getPath(policy));
+            } catch (IOException | ServiceException e) {
+                logger.debug("Could not delete policy from database: {}", e.getMessage());
+            }
+        }
+        policiesId.remove(policy.getId());
+        policiesRic.remove(policy.getRic().id(), policy.getId());
+        policiesService.remove(policy.getOwnerServiceId(), policy.getId());
+        policiesType.remove(policy.getType().getId(), policy.getId());
     }
 
     public synchronized void removePoliciesForRic(String ricId) {
@@ -127,5 +158,90 @@
             Set<String> keys = policiesId.keySet();
             removeId(keys.iterator().next());
         }
+        try {
+            if (this.appConfig.getVardataDirectory() != null) {
+                FileSystemUtils.deleteRecursively(getDatabasePath());
+            }
+        } catch (IOException | ServiceException e) {
+            logger.warn("Could not delete policy database : {}", e.getMessage());
+        }
+    }
+
+    public void store(Policy policy) {
+        try {
+            Files.createDirectories(getDatabasePath(policy.getRic()));
+            try (PrintStream out = new PrintStream(new FileOutputStream(getFile(policy)))) {
+                out.print(gson.toJson(toStorageObject(policy)));
+            }
+        } catch (Exception e) {
+            logger.warn("Could not store policy: {} {}", policy.getId(), e.getMessage());
+        }
+    }
+
+    private File getFile(Policy policy) throws ServiceException {
+        return getPath(policy).toFile();
+    }
+
+    private Path getPath(Policy policy) throws ServiceException {
+        return Path.of(getDatabaseDirectory(policy.getRic()), policy.getId() + ".json");
+    }
+
+    public void restoreFromDatabase(Ric ric, PolicyTypes types) {
+
+        try {
+            Files.createDirectories(getDatabasePath(ric));
+            for (File file : getDatabasePath(ric).toFile().listFiles()) {
+                String json = Files.readString(file.toPath());
+                PersistentPolicyInfo policyStorage = gson.fromJson(json, PersistentPolicyInfo.class);
+                this.put(toPolicy(policyStorage, ric, types));
+            }
+        } catch (ServiceException | IOException e) {
+            logger.warn("Could not restore policy database for RIC: {}, reason : {}", ric.id(), e.getMessage());
+        }
+    }
+
+    private PersistentPolicyInfo toStorageObject(Policy p) {
+        return PersistentPolicyInfo.builder() //
+                .id(p.getId()) //
+                .json(p.getJson()) //
+                .ownerServiceId(p.getOwnerServiceId()) //
+                .ricId(p.getRic().id()) //
+                .statusNotificationUri(p.getStatusNotificationUri()) //
+                .typeId(p.getType().getId()) //
+                .isTransient(p.isTransient()) //
+                .lastModified(p.getLastModified().toString()) //
+                .build();
+    }
+
+    Policy toPolicy(PersistentPolicyInfo p, Ric ric, PolicyTypes types) throws EntityNotFoundException {
+        return Policy.builder() //
+                .id(p.getId()) //
+                .isTransient(p.isTransient()) //
+                .json(p.getJson()) //
+                .lastModified(Instant.parse(p.lastModified)) //
+                .ownerServiceId(p.getOwnerServiceId()) //
+                .ric(ric) //
+                .statusNotificationUri(p.getStatusNotificationUri()) //
+                .type(types.getType(p.getTypeId())) //
+                .build();
+    }
+
+    private Path getDatabasePath(Ric ric) throws ServiceException {
+        return Path.of(getDatabaseDirectory(ric));
+    }
+
+    private String getDatabaseDirectory(Ric ric) throws ServiceException {
+        return getDatabaseDirectory() + "/" + ric.id();
+    }
+
+    private String getDatabaseDirectory() throws ServiceException {
+        if (appConfig.getVardataDirectory() == null) {
+            throw new ServiceException("No database storage provided");
+        }
+        return appConfig.getVardataDirectory() + "/database/policyInstances";
+    }
+
+    private Path getDatabasePath() throws ServiceException {
+        return Path.of(getDatabaseDirectory());
     }
 }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policy.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policy.java
index efafa68..bdf1632 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policy.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Policy.java
@@ -22,25 +22,25 @@
 
 import java.time.Instant;
 
-import org.immutables.gson.Gson;
-import org.immutables.value.Value;
+import lombok.Builder;
+import lombok.Getter;
 
-@Value.Immutable
-@Gson.TypeAdapters
-public interface Policy {
-    public String id();
+@Getter
+@Builder
+public class Policy {
+    private String id;
 
-    public String json();
+    private String json;
 
-    public String ownerServiceId();
+    private String ownerServiceId;
 
-    public Ric ric();
+    private Ric ric;
 
-    public PolicyType type();
+    private PolicyType type;
 
-    public Instant lastModified();
+    private Instant lastModified;
 
-    public boolean isTransient();
+    private boolean isTransient;
 
-    public String statusNotificationUri();
+    private String statusNotificationUri;
 }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyType.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyType.java
index f2c6254..9fbae6d 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyType.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyType.java
@@ -20,13 +20,13 @@
 
 package org.onap.ccsdk.oran.a1policymanagementservice.repository;
 
-import org.immutables.gson.Gson;
-import org.immutables.value.Value;
+import lombok.Builder;
+import lombok.Getter;
 
-@Value.Immutable
-@Gson.TypeAdapters
-public interface PolicyType {
-    public String id();
+@Getter
+@Builder
+public class PolicyType {
+    private String id;
 
-    public String schema();
+    private String schema;
 }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyTypes.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyTypes.java
index 7bf0378..76f0e21 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyTypes.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/PolicyTypes.java
@@ -20,15 +20,41 @@
 
 package org.onap.ccsdk.oran.a1policymanagementservice.repository;
 
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.invoke.MethodHandles;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Vector;
 
+import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.EntityNotFoundException;
+import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.FileSystemUtils;
 
+@Configuration
 public class PolicyTypes {
+    private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
     private Map<String, PolicyType> types = new HashMap<>();
+    private final ApplicationConfig appConfig;
+    private static Gson gson = new GsonBuilder().create();
+
+    public PolicyTypes(@Autowired ApplicationConfig appConfig) {
+        this.appConfig = appConfig;
+        restoreFromDatabase();
+    }
 
     public synchronized PolicyType getType(String name) throws EntityNotFoundException {
         PolicyType t = types.get(name);
@@ -43,7 +69,8 @@
     }
 
     public synchronized void put(PolicyType type) {
-        types.put(type.id(), type);
+        types.put(type.getId(), type);
+        store(type);
     }
 
     public synchronized boolean contains(String policyType) {
@@ -60,5 +87,54 @@
 
     public synchronized void clear() {
         this.types.clear();
+        try {
+            FileSystemUtils.deleteRecursively(getDatabasePath());
+        } catch (IOException | ServiceException e) {
+            logger.warn("Could not delete policy type database : {}", e.getMessage());
+        }
+    }
+
+    public void store(PolicyType type) {
+        try {
+            Files.createDirectories(getDatabasePath());
+            try (PrintStream out = new PrintStream(new FileOutputStream(getFile(type)))) {
+                out.print(gson.toJson(type));
+            }
+        } catch (ServiceException e) {
+            logger.debug("Could not store policy type: {} {}", type.getId(), e.getMessage());
+        } catch (IOException e) {
+            logger.warn("Could not store policy type: {} {}", type.getId(), e.getMessage());
+        }
+    }
+
+    private File getFile(PolicyType type) throws ServiceException {
+        return Path.of(getDatabaseDirectory(), type.getId() + ".json").toFile();
+    }
+
+    void restoreFromDatabase() {
+        try {
+            Files.createDirectories(getDatabasePath());
+            for (File file : getDatabasePath().toFile().listFiles()) {
+                String json = Files.readString(file.toPath());
+                PolicyType type = gson.fromJson(json, PolicyType.class);
+                this.types.put(type.getId(), type);
+            }
+
+        } catch (IOException e) {
+            logger.warn("Could not restore policy type database : {}", e.getMessage());
+        } catch (ServiceException e) {
+            logger.debug("Could not restore policy type database : {}", e.getMessage());
+        }
+    }
+
+    private String getDatabaseDirectory() throws ServiceException {
+        if (appConfig.getVardataDirectory() == null) {
+            throw new ServiceException("No policy type storage provided");
+        }
+        return appConfig.getVardataDirectory() + "/database/policyTypes";
+    }
+
+    private Path getDatabasePath() throws ServiceException {
+        return Path.of(getDatabaseDirectory());
     }
 }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Ric.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Ric.java
index c7f471e..9c4b275 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Ric.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/repository/Ric.java
@@ -110,7 +110,7 @@
      * @param type the policy type to support.
      */
     public synchronized void addSupportedPolicyType(PolicyType type) {
-        supportedPolicyTypes.put(type.id(), type);
+        supportedPolicyTypes.put(type.getId(), type);
     }
 
     /**
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTask.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTask.java
index 29d2e4e..771dea5 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTask.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTask.java
@@ -226,6 +226,9 @@
     private void addRic(RicConfig config) {
         Ric ric = new Ric(config);
         this.rics.put(ric);
+        if (this.appConfig.getVardataDirectory() != null) {
+            this.policies.restoreFromDatabase(ric, this.policyTypes);
+        }
         runRicSynchronization(ric);
     }
 
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTask.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTask.java
index b38a36b..1922237 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTask.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTask.java
@@ -26,7 +26,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.controllers.ServiceCallbacks;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Lock.LockType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
@@ -177,7 +176,7 @@
     }
 
     private Mono<PolicyType> createPolicyType(String policyTypeId, String schema) {
-        PolicyType pt = ImmutablePolicyType.builder().id(policyTypeId).schema(schema).build();
+        PolicyType pt = PolicyType.builder().id(policyTypeId).schema(schema).build();
         policyTypes.put(pt);
         return Mono.just(pt);
     }
@@ -189,7 +188,7 @@
     }
 
     private Flux<Policy> putPolicy(Policy policy, Ric ric, A1Client a1Client) {
-        logger.debug("Recreating policy: {}, for ric: {}", policy.id(), ric.getConfig().ricId());
+        logger.debug("Recreating policy: {}, for ric: {}", policy.getId(), ric.getConfig().ricId());
         return a1Client.putPolicy(policy) //
                 .flatMapMany(notUsed -> Flux.just(policy));
     }
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervision.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervision.java
index 4c063e2..d605b69 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervision.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervision.java
@@ -91,15 +91,15 @@
 
     @SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
     private Flux<Policy> deletePolicy(Policy policy) {
-        Lock lock = policy.ric().getLock();
+        Lock lock = policy.getRic().getLock();
         return lock.lock(LockType.SHARED) //
                 .doOnNext(notUsed -> policies.remove(policy)) //
                 .flatMap(notUsed -> deletePolicyInRic(policy))
                 .doOnNext(notUsed -> logger.debug("Policy deleted due to service inactivity: {}, service: {}",
-                        policy.id(), policy.ownerServiceId())) //
+                        policy.getId(), policy.getOwnerServiceId())) //
                 .doOnNext(notUsed -> lock.unlockBlocking()) //
                 .doOnError(throwable -> lock.unlockBlocking()) //
-                .doOnError(throwable -> logger.debug("Failed to delete inactive policy: {}, reason: {}", policy.id(),
+                .doOnError(throwable -> logger.debug("Failed to delete inactive policy: {}, reason: {}", policy.getId(),
                         throwable.getMessage())) //
                 .flatMapMany(notUsed -> Flux.just(policy)) //
                 .onErrorResume(throwable -> Flux.empty());
@@ -110,14 +110,14 @@
     }
 
     private Mono<Policy> deletePolicyInRic(Policy policy) {
-        return a1ClientFactory.createA1Client(policy.ric()) //
+        return a1ClientFactory.createA1Client(policy.getRic()) //
                 .flatMap(client -> client.deletePolicy(policy) //
                         .onErrorResume(exception -> handleDeleteFromRicFailure(policy, exception)) //
                         .map(nothing -> policy));
     }
 
     private Mono<String> handleDeleteFromRicFailure(Policy policy, Throwable e) {
-        logger.warn("Could not delete policy: {} from ric: {}. Cause: {}", policy.id(), policy.ric().id(),
+        logger.warn("Could not delete policy: {} from ric: {}. Cause: {}", policy.getId(), policy.getRic().id(),
                 e.getMessage());
         return Mono.empty();
     }
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java
index e6834e7..b007640 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java
@@ -34,8 +34,6 @@
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
@@ -59,8 +57,10 @@
 @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
 @TestPropertySource(properties = { //
         "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks"})
-@SuppressWarnings("java:S3577") // Class name should start or end with Test. This is not a test class per se, but a mock
+        "app.webclient.trust-store=./config/truststore.jks", //
+        "app.vardata-directory=./target"})
+@SuppressWarnings("java:S3577") // Class name should start or end with Test. This is not a test class per se,
+                                // but a mock
                                 // of the server.
 class MockPolicyManagementService {
     private static final Logger logger = LoggerFactory.getLogger(MockPolicyManagementService.class);
@@ -91,9 +91,8 @@
     @TestConfiguration
     static class TestBeanFactory {
 
+        private final ApplicationConfig applicationConfig = new MockApplicationConfig();
         private final Rics rics = new Rics();
-        private final Policies policies = new Policies();
-        private final PolicyTypes policyTypes = new PolicyTypes();
 
         @Bean
         public ApplicationConfig getApplicationConfig() {
@@ -101,20 +100,10 @@
         }
 
         @Bean
-        public MockA1ClientFactory getA1ClientFactory() {
-            PolicyTypes ricTypes = new PolicyTypes();
+        public MockA1ClientFactory getA1ClientFactory(@Autowired ApplicationConfig appConfig) {
+            PolicyTypes ricTypes = new PolicyTypes(applicationConfig);
             loadTypes(ricTypes);
-            return new MockA1ClientFactory(ricTypes);
-        }
-
-        @Bean
-        public Policies getPolicies() {
-            return this.policies;
-        }
-
-        @Bean
-        public PolicyTypes getPolicyTypes() {
-            return this.policyTypes;
+            return new MockA1ClientFactory(appConfig, ricTypes);
         }
 
         @Bean
@@ -136,13 +125,13 @@
                 try {
                     String schema = readFile(file);
                     String typeName = title(schema);
-                    PolicyType type = ImmutablePolicyType.builder().id(typeName).schema(schema).build();
+                    PolicyType type = PolicyType.builder().id(typeName).schema(schema).build();
                     policyTypes.put(type);
                 } catch (Exception e) {
                     logger.error("Could not load json schema ", e);
                 }
             }
-            policyTypes.put(ImmutablePolicyType.builder().id("").schema("{}").build());
+            policyTypes.put(PolicyType.builder().id("").schema("{}").build());
         }
     }
 
@@ -186,7 +175,7 @@
         Ric ric = rics.get("ric1");
         String json = getConfigJsonFromFile();
 
-        Policy policy = ImmutablePolicy.builder() //
+        Policy policy = Policy.builder() //
                 .id("typelessPolicy") //
                 .json(json) //
                 .ownerServiceId("MockPolicyManagementService") //
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java
index 65dc8b5..dbfc7d9 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java
@@ -48,6 +48,8 @@
 
     private LogAspect sampleAspect = new LogAspect();
 
+    LoggingUtils utils;
+
     @Test
     void testExecutetimeTime_shouldLogTime() throws Throwable {
         when(proceedingJoinPoint.getSignature()).thenReturn(methodSignature);
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientHelper.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientHelper.java
index 100e95e..eb00713 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientHelper.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientHelper.java
@@ -27,8 +27,6 @@
 import org.json.JSONObject;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ImmutableRicConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.RicConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric;
@@ -57,7 +55,7 @@
 
     protected static Policy createPolicy(String nearRtRicUrl, String policyId, String json, String type) {
         String callbackUrl = "https://test.com";
-        return ImmutablePolicy.builder() //
+        return Policy.builder() //
                 .id(policyId) //
                 .json(json) //
                 .ownerServiceId("service") //
@@ -70,7 +68,7 @@
     }
 
     protected static PolicyType createPolicyType(String name) {
-        return ImmutablePolicyType.builder().id(name).schema("schema").build();
+        return PolicyType.builder().id(name).schema("schema").build();
     }
 
     protected static String getCreateSchema(String policyType, String policyTypeId) {
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java
index b516488..bc22c14 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java
@@ -40,9 +40,9 @@
 import java.util.List;
 
 import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClient;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
@@ -51,8 +51,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.RicConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.WebClientConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Lock.LockType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
@@ -91,7 +89,8 @@
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 @TestPropertySource(properties = { //
         "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks"})
+        "app.webclient.trust-store=./config/truststore.jks", //
+        "app.vardata-directory=./target"})
 class ApplicationTest {
     private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
 
@@ -126,6 +125,7 @@
         public String getLocalConfigurationFilePath() {
             return ""; // No config file loaded for the test
         }
+
     }
 
     /**
@@ -133,10 +133,6 @@
      */
     @TestConfiguration
     static class TestBeanFactory {
-        private final PolicyTypes policyTypes = new PolicyTypes();
-        private final Services services = new Services();
-        private final Policies policies = new Policies();
-        MockA1ClientFactory a1ClientFactory = null;
 
         @Bean
         public ApplicationConfig getApplicationConfig() {
@@ -144,32 +140,15 @@
         }
 
         @Bean
-        MockA1ClientFactory getA1ClientFactory() {
-            if (a1ClientFactory == null) {
-                this.a1ClientFactory = new MockA1ClientFactory(this.policyTypes);
-            }
-            return this.a1ClientFactory;
+        MockA1ClientFactory getA1ClientFactory(@Autowired ApplicationConfig appConfig, @Autowired PolicyTypes types) {
+            return new MockA1ClientFactory(appConfig, types);
         }
 
         @Bean
-        public PolicyTypes getPolicyTypes() {
-            return this.policyTypes;
-        }
-
-        @Bean
-        Policies getPolicies() {
-            return this.policies;
-        }
-
-        @Bean
-        Services getServices() {
-            return this.services;
-        }
-
-        @Bean
-        public ServiceSupervision getServiceSupervision() {
+        public ServiceSupervision getServiceSupervision(@Autowired Services services,
+                @Autowired A1ClientFactory a1ClientFactory, @Autowired Policies policies) {
             Duration checkInterval = Duration.ofMillis(1);
-            return new ServiceSupervision(this.services, this.policies, this.getA1ClientFactory(), checkInterval);
+            return new ServiceSupervision(services, policies, a1ClientFactory, checkInterval);
         }
 
         @Bean
@@ -182,7 +161,7 @@
     @LocalServerPort
     private int port;
 
-    @BeforeEach
+    @AfterEach
     void reset() {
         rics.clear();
         policies.clear();
@@ -233,7 +212,7 @@
     @Test
     void testSynchronization() throws Exception {
         // Two polictypes will be put in the NearRT RICs
-        PolicyTypes nearRtRicPolicyTypes = new PolicyTypes();
+        PolicyTypes nearRtRicPolicyTypes = new PolicyTypes(this.applicationConfig);
         nearRtRicPolicyTypes.put(createPolicyType("typeName"));
         nearRtRicPolicyTypes.put(createPolicyType("typeName2"));
         this.a1ClientFactory.setPolicyTypes(nearRtRicPolicyTypes);
@@ -259,7 +238,7 @@
         Policies ricPolicies = getA1Client(ric1Name).getPolicies();
         assertThat(ricPolicies.size()).isEqualTo(1);
         Policy ricPolicy = ricPolicies.get(policyId);
-        assertThat(ricPolicy.json()).isEqualTo(policy.json());
+        assertThat(ricPolicy.getJson()).isEqualTo(policy.getJson());
 
         // Both types should be in the Policy Management Service's storage after the
         // synch
@@ -320,9 +299,9 @@
 
         Policy policy = policies.getPolicy(policyInstanceId);
         assertThat(policy).isNotNull();
-        assertThat(policy.id()).isEqualTo(policyInstanceId);
-        assertThat(policy.ownerServiceId()).isEqualTo(serviceName);
-        assertThat(policy.ric().id()).isEqualTo("ric1");
+        assertThat(policy.getId()).isEqualTo(policyInstanceId);
+        assertThat(policy.getOwnerServiceId()).isEqualTo(serviceName);
+        assertThat(policy.getRic().id()).isEqualTo("ric1");
         assertThat(policy.isTransient()).isTrue();
 
         // Put a non transient policy
@@ -428,7 +407,7 @@
         Policy policy = addPolicy("id", "typeName", "service1", "ric1");
         {
             String rsp = restClient().get(url).block();
-            assertThat(rsp).isEqualTo(policy.json());
+            assertThat(rsp).isEqualTo(policy.getJson());
         }
         {
             policies.remove(policy);
@@ -660,7 +639,7 @@
 
     private Policy addPolicy(String id, String typeName, String service, String ric) throws ServiceException {
         addRic(ric);
-        Policy policy = ImmutablePolicy.builder() //
+        Policy policy = Policy.builder() //
                 .id(id) //
                 .json(jsonString()) //
                 .ownerServiceId(service) //
@@ -755,7 +734,7 @@
     }
 
     private PolicyType createPolicyType(String policyTypeName) {
-        return ImmutablePolicyType.builder() //
+        return PolicyType.builder() //
                 .id(policyTypeName) //
                 .schema("{\"title\":\"" + policyTypeName + "\"}") //
                 .build();
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
index 6825595..84ac596 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
@@ -44,9 +44,9 @@
 
 import org.json.JSONObject;
 import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClient;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
@@ -56,8 +56,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.WebClientConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.controllers.ServiceCallbackInfo;
 import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Lock.LockType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
@@ -98,7 +96,10 @@
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 @TestPropertySource(properties = { //
         "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks"})
+        "app.webclient.trust-store=./config/truststore.jks", //
+        "app.vardata-directory=./target/testdata", //
+        "app.filepath=" //
+})
 class ApplicationTest {
     private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
 
@@ -131,68 +132,34 @@
 
     private static Gson gson = new GsonBuilder().create();
 
-    public static class MockApplicationConfig extends ApplicationConfig {
-        @Override
-        public String getLocalConfigurationFilePath() {
-            return ""; // No config file loaded for the test
-        }
-    }
-
     /**
      * Overrides the BeanFactory.
      */
     @TestConfiguration
     static class TestBeanFactory {
-        private final PolicyTypes policyTypes = new PolicyTypes();
-        private final Services services = new Services();
-        private final Policies policies = new Policies();
-        MockA1ClientFactory a1ClientFactory = null;
 
         @Bean
-        public ApplicationConfig getApplicationConfig() {
-            return new MockApplicationConfig();
+        A1ClientFactory getA1ClientFactory(@Autowired ApplicationConfig appConfig, @Autowired PolicyTypes types) {
+            return new MockA1ClientFactory(appConfig, types);
         }
 
         @Bean
-        MockA1ClientFactory getA1ClientFactory() {
-            if (a1ClientFactory == null) {
-                this.a1ClientFactory = new MockA1ClientFactory(this.policyTypes);
-            }
-            return this.a1ClientFactory;
-        }
-
-        @Bean
-        public PolicyTypes getPolicyTypes() {
-            return this.policyTypes;
-        }
-
-        @Bean
-        Policies getPolicies() {
-            return this.policies;
-        }
-
-        @Bean
-        Services getServices() {
-            return this.services;
-        }
-
-        @Bean
-        public ServiceSupervision getServiceSupervision() {
+        public ServiceSupervision getServiceSupervision(@Autowired Services services,
+                @Autowired A1ClientFactory a1ClientFactory, @Autowired Policies policies) {
             Duration checkInterval = Duration.ofMillis(1);
-            return new ServiceSupervision(this.services, this.policies, this.getA1ClientFactory(), checkInterval);
+            return new ServiceSupervision(services, policies, a1ClientFactory, checkInterval);
         }
 
         @Bean
         public ServletWebServerFactory servletContainer() {
             return new TomcatServletWebServerFactory();
         }
-
     }
 
     @LocalServerPort
     private int port;
 
-    @BeforeEach
+    @AfterEach
     void reset() {
         rics.clear();
         policies.clear();
@@ -229,6 +196,31 @@
     }
 
     @Test
+    void testPersistence() throws ServiceException {
+        Ric ric = this.addRic("ric1");
+        PolicyType type = this.addPolicyType("type1", ric.id());
+        PolicyTypes types = new PolicyTypes(this.applicationConfig);
+        assertThat(types.size()).isEqualTo(1);
+
+        addPolicy("id", type.getId(), "service", ric.id());
+        addPolicy("id2", type.getId(), "service", ric.id());
+
+        {
+            Policies policies = new Policies(this.applicationConfig);
+            policies.restoreFromDatabase(ric, types);
+            assertThat(policies.size()).isEqualTo(2);
+        }
+
+        {
+            restClient().delete("/policies/id2").block();
+            Policies policies = new Policies(this.applicationConfig);
+            policies.restoreFromDatabase(ric, types);
+            assertThat(policies.size()).isEqualTo(1);
+        }
+
+    }
+
+    @Test
     void testGetRics() throws Exception {
         addRic("ric1");
         this.addPolicyType("type1", "ric1");
@@ -260,7 +252,7 @@
     @Test
     void testSynchronization() throws Exception {
         // Two polictypes will be put in the NearRT RICs
-        PolicyTypes nearRtRicPolicyTypes = new PolicyTypes();
+        PolicyTypes nearRtRicPolicyTypes = new PolicyTypes(this.applicationConfig);
         nearRtRicPolicyTypes.put(createPolicyType("typeName"));
         nearRtRicPolicyTypes.put(createPolicyType("typeName2"));
         this.a1ClientFactory.setPolicyTypes(nearRtRicPolicyTypes);
@@ -286,7 +278,7 @@
         Policies ricPolicies = getA1Client(ric1Name).getPolicies();
         assertThat(ricPolicies.size()).isEqualTo(1);
         Policy ricPolicy = ricPolicies.get(policyId);
-        assertThat(ricPolicy.json()).isEqualTo(policy.json());
+        assertThat(ricPolicy.getJson()).isEqualTo(policy.getJson());
 
         // Both types should be in the Policy Management Service's storage after the
         // synch
@@ -357,9 +349,9 @@
 
         Policy policy = policies.getPolicy(policyInstanceId);
         assertThat(policy).isNotNull();
-        assertThat(policy.id()).isEqualTo(policyInstanceId);
-        assertThat(policy.ownerServiceId()).isEqualTo(serviceName);
-        assertThat(policy.ric().id()).isEqualTo(ricId);
+        assertThat(policy.getId()).isEqualTo(policyInstanceId);
+        assertThat(policy.getOwnerServiceId()).isEqualTo(serviceName);
+        assertThat(policy.getRic().id()).isEqualTo(ricId);
         assertThat(policy.isTransient()).isTrue();
 
         // Put a non transient policy
@@ -460,7 +452,7 @@
             String rsp = restClient().get(url).block();
             PolicyInfo info = gson.fromJson(rsp, PolicyInfo.class);
             String policyStr = gson.toJson(info.policyData);
-            assertThat(policyStr).isEqualTo(policy.json());
+            assertThat(policyStr).isEqualTo(policy.getJson());
         }
         {
             policies.remove(policy);
@@ -711,7 +703,7 @@
 
     private Policy addPolicy(String id, String typeName, String service, String ric) throws ServiceException {
         addRic(ric);
-        Policy policy = ImmutablePolicy.builder() //
+        Policy policy = Policy.builder() //
                 .id(id) //
                 .json(jsonString()) //
                 .ownerServiceId(service) //
@@ -861,7 +853,7 @@
     }
 
     private PolicyType createPolicyType(String policyTypeName) {
-        return ImmutablePolicyType.builder() //
+        return PolicyType.builder() //
                 .id(policyTypeName) //
                 .schema("{\"title\":\"" + policyTypeName + "\"}") //
                 .build();
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConcurrencyTestRunnable.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConcurrencyTestRunnable.java
index ded864f..3a4aae8 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConcurrencyTestRunnable.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConcurrencyTestRunnable.java
@@ -27,7 +27,6 @@
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClient;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes;
@@ -112,7 +111,7 @@
     private Policy createPolicyObject(String id) {
         Ric ric = this.rics.get("ric");
         PolicyType type = this.types.get("type1");
-        return ImmutablePolicy.builder() //
+        return Policy.builder() //
                 .id(id) //
                 .json("{}") //
                 .type(type) //
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java
index 482c94f..6192c93 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java
@@ -59,7 +59,8 @@
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 @TestPropertySource(properties = { //
         "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks"})
+        "app.webclient.trust-store=./config/truststore.jks", //
+        "app.vardata-directory=./target"})
 class ConfigurationControllerTest {
     @Autowired
     ApplicationContext context;
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumerTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumerTest.java
index 72ca84a..3b810ad 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumerTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageConsumerTest.java
@@ -22,7 +22,6 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doReturn;
@@ -37,6 +36,7 @@
 
 import java.util.ArrayList;
 
+import org.junit.Assert;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -99,7 +99,7 @@
         String s = messageConsumerUnderTest.createTask().blockLast();
         assertEquals("responseFromHandler", s);
         verify(messageConsumerUnderTest, times(2)).delay();
-        verify(messageConsumerUnderTest, times(1)).handleDmaapMsg(dmaapRequestMessage());
+        verify(messageConsumerUnderTest, times(1)).handleDmaapMsg(any());
     }
 
     @Test
@@ -123,7 +123,7 @@
         verify(messageConsumerUnderTest, times(2)).getFromMessageRouter(anyString());
         verify(messageConsumerUnderTest, times(0)).sendErrorResponse(anyString());
         verify(messageConsumerUnderTest, times(1)).delay();
-        verify(messageConsumerUnderTest, times(1)).handleDmaapMsg(dmaapRequestMessage());
+        verify(messageConsumerUnderTest, times(1)).handleDmaapMsg(any());
         assertEquals("response1", s);
     }
 
@@ -164,14 +164,17 @@
             DmaapRequestMessage parsedMessage =
                     messageConsumerUnderTest.parseReceivedMessage(jsonArrayOfObject).blockLast();
             assertNotNull(parsedMessage);
-            assertTrue(parsedMessage.payload().isPresent());
+            assertNotNull(parsedMessage.getPayload());
+
+            Assert.assertEquals(dmaapRequestMessage(), parsedMessage);
         }
         {
             String jsonArrayOfString = jsonArray(quote(json));
             DmaapRequestMessage parsedMessage =
                     messageConsumerUnderTest.parseReceivedMessage(jsonArrayOfString).blockLast();
             assertNotNull(parsedMessage);
-            assertTrue(parsedMessage.payload().isPresent());
+            assertNotNull(parsedMessage.getPayload());
+            Assert.assertEquals(dmaapRequestMessage(), parsedMessage);
         }
 
     }
@@ -190,7 +193,7 @@
     }
 
     private DmaapRequestMessage dmaapRequestMessage() {
-        return ImmutableDmaapRequestMessage.builder() //
+        return DmaapRequestMessage.builder() //
                 .apiVersion("apiVersion") //
                 .correlationId("correlationId") //
                 .operation(Operation.PUT) //
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandlerTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandlerTest.java
index df84ae0..285f3c4 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandlerTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/dmaap/DmaapMessageHandlerTest.java
@@ -38,7 +38,6 @@
 
 import java.io.IOException;
 import java.nio.charset.Charset;
-import java.util.Optional;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -76,10 +75,8 @@
     }
 
     DmaapRequestMessage dmaapRequestMessage(Operation operation) {
-        Optional<JsonObject> payload =
-                ((operation == Operation.PUT || operation == Operation.POST) ? Optional.of(payloadAsJson())
-                        : Optional.empty());
-        return ImmutableDmaapRequestMessage.builder() //
+        JsonObject payload = ((operation == Operation.PUT || operation == Operation.POST) ? payloadAsJson() : null);
+        return DmaapRequestMessage.builder() //
                 .apiVersion("apiVersion") //
                 .correlationId("correlationId") //
                 .operation(operation) //
@@ -224,12 +221,12 @@
 
     @Test
     void putWithoutPayload_thenNotFoundResponseWithWarning() throws Exception {
-        DmaapRequestMessage message = ImmutableDmaapRequestMessage.builder() //
+        DmaapRequestMessage message = DmaapRequestMessage.builder() //
                 .apiVersion("apiVersion") //
                 .correlationId("correlationId") //
                 .operation(DmaapRequestMessage.Operation.PUT) //
                 .originatorId("originatorId") //
-                .payload(Optional.empty()) //
+                .payload(null) //
                 .requestId("requestId") //
                 .target("target") //
                 .timestamp("timestamp") //
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java
index e789de6..045b110 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java
@@ -65,10 +65,9 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ImmutableConfigParserResult;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ImmutableRicConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.RicConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
+import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Rics;
@@ -116,14 +115,14 @@
     }
 
     private RefreshConfigTask createTestObject(boolean configFileExists) {
-        return createTestObject(configFileExists, new Rics(), new Policies(), true);
+        return createTestObject(configFileExists, new Rics(), new Policies(appConfig), true);
     }
 
     private RefreshConfigTask createTestObject(boolean configFileExists, Rics rics, Policies policies,
             boolean stubConfigFileExists) {
 
         RefreshConfigTask obj = spy(new RefreshConfigTask(configurationFileMock, appConfig, rics, policies,
-                new Services(), new PolicyTypes(), new A1ClientFactory(appConfig)));
+                new Services(), new PolicyTypes(appConfig), new A1ClientFactory(appConfig)));
         if (stubConfigFileExists) {
             when(configurationFileMock.readFile()).thenReturn(Optional.empty());
         }
@@ -203,7 +202,7 @@
     @Test
     void whenPeriodicConfigRefreshSuccess_thenNewConfigIsCreatedAndRepositoryUpdated() throws Exception {
         Rics rics = new Rics();
-        Policies policies = new Policies();
+        Policies policies = new Policies(appConfig);
         refreshTaskUnderTest = this.createTestObject(CONFIG_FILE_DOES_NOT_EXIST, rics, policies, false);
         refreshTaskUnderTest.systemEnvironment = new Properties();
 
@@ -251,7 +250,7 @@
     @Test
     void whenPeriodicConfigRefreshInvalidJson_thenErrorIsLogged() throws Exception {
         Rics rics = new Rics();
-        Policies policies = new Policies();
+        Policies policies = new Policies(appConfig);
         refreshTaskUnderTest = this.createTestObject(CONFIG_FILE_DOES_NOT_EXIST, rics, policies, false);
         refreshTaskUnderTest.systemEnvironment = new Properties();
 
@@ -289,11 +288,11 @@
     }
 
     private Policy getPolicy(Ric ric) {
-        ImmutablePolicyType type = ImmutablePolicyType.builder() //
+        PolicyType type = PolicyType.builder() //
                 .id("type") //
                 .schema("{}") //
                 .build();
-        Policy policy = ImmutablePolicy.builder() //
+        Policy policy = Policy.builder() //
                 .id("id") //
                 .type(type) //
                 .lastModified(Instant.now()) //
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java
index 4e72bbf..525eeff 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java
@@ -45,8 +45,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ImmutableRicConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Lock.LockType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
@@ -60,7 +58,7 @@
 @ExtendWith(MockitoExtension.class)
 class RicSupervisionTest {
     private static final String POLICY_TYPE_1_NAME = "type1";
-    private static final PolicyType POLICY_TYPE_1 = ImmutablePolicyType.builder() //
+    private static final PolicyType POLICY_TYPE_1 = PolicyType.builder() //
             .id(POLICY_TYPE_1_NAME) //
             .schema("") //
             .build();
@@ -73,7 +71,7 @@
             .build());
 
     private static final String POLICY_1_ID = "policyId1";
-    private static final Policy POLICY_1 = ImmutablePolicy.builder() //
+    private static final Policy POLICY_1 = Policy.builder() //
             .id(POLICY_1_ID) //
             .json("") //
             .ownerServiceId("service") //
@@ -84,7 +82,7 @@
             .statusNotificationUri("statusNotificationUri") //
             .build();
 
-    private static final Policy POLICY_2 = ImmutablePolicy.builder() //
+    private static final Policy POLICY_2 = Policy.builder() //
             .id("policyId2") //
             .json("") //
             .ownerServiceId("service") //
@@ -104,14 +102,17 @@
     @Mock
     private RicSynchronizationTask synchronizationTaskMock;
 
-    private final PolicyTypes types = new PolicyTypes();
-    private Policies policies = new Policies();
+    private final ApplicationConfig appConfig = new ApplicationConfig();
+
+    private PolicyTypes types;
+    private Policies policies;
     private Rics rics = new Rics();
 
     @BeforeEach
     void init() {
-        types.clear();
-        policies.clear();
+        types = new PolicyTypes(appConfig);
+        policies = new Policies(appConfig);
+
         rics.clear();
         RIC_1.setState(RicState.UNAVAILABLE);
         RIC_1.clearSupportedPolicyTypes();
@@ -287,7 +288,7 @@
     @Test
     void whenRicIdleAndSameAmountOfPolicyTypesButNotSameTypes_thenSynchronization() {
         doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
-        PolicyType policyType2 = ImmutablePolicyType.builder() //
+        PolicyType policyType2 = PolicyType.builder() //
                 .id("policyType2") //
                 .schema("") //
                 .build();
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
index ea4ca97..2902d45 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
@@ -49,8 +49,6 @@
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.AsyncRestClientFactory;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ImmutableRicConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
@@ -68,7 +66,7 @@
 @ExtendWith(MockitoExtension.class)
 class RicSynchronizationTaskTest {
     private static final String POLICY_TYPE_1_NAME = "type1";
-    private static final PolicyType POLICY_TYPE_1 = ImmutablePolicyType.builder() //
+    private static final PolicyType POLICY_TYPE_1 = PolicyType.builder() //
             .id(POLICY_TYPE_1_NAME) //
             .schema("") //
             .build();
@@ -82,7 +80,7 @@
             .build());
 
     private static Policy createPolicy(String policyId, boolean isTransient) {
-        return ImmutablePolicy.builder() //
+        return Policy.builder() //
                 .id(policyId) //
                 .json("") //
                 .ownerServiceId("service") //
@@ -111,10 +109,12 @@
     private Services services;
     private Rics rics;
 
+    private final ApplicationConfig appConfig = new ApplicationConfig();
+
     @BeforeEach
     void init() {
-        policyTypes = new PolicyTypes();
-        policies = new Policies();
+        policyTypes = new PolicyTypes(appConfig);
+        policies = new Policies(appConfig);
         services = new Services();
         rics = new Rics();
         RIC_1.setState(RicState.UNAVAILABLE);
@@ -196,7 +196,7 @@
         verifyNoMoreInteractions(a1ClientMock);
 
         assertThat(policyTypes.size()).isEqualTo(1);
-        assertThat(policyTypes.getType(POLICY_TYPE_1_NAME).schema()).isEqualTo(typeSchema);
+        assertThat(policyTypes.getType(POLICY_TYPE_1_NAME).getSchema()).isEqualTo(typeSchema);
         assertThat(policies.size()).isZero();
         assertThat(RIC_1.getState()).isEqualTo(RicState.AVAILABLE);
     }
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java
index c847622..4c0e96f 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java
@@ -43,10 +43,9 @@
 import org.mockito.junit.jupiter.MockitoExtension;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1Client;
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1ClientFactory;
+import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ImmutableRicConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.configuration.RicConfig;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicy;
-import org.onap.ccsdk.oran.a1policymanagementservice.repository.ImmutablePolicyType;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
@@ -78,11 +77,11 @@
             .controllerName("") //
             .build();
     private Ric ric = new Ric(ricConfig);
-    private PolicyType policyType = ImmutablePolicyType.builder() //
+    private PolicyType policyType = PolicyType.builder() //
             .id("policyTypeName") //
             .schema("schema") //
             .build();
-    private Policy policy = ImmutablePolicy.builder() //
+    private Policy policy = Policy.builder() //
             .id(POLICY_ID) //
             .json("json") //
             .ownerServiceId(SERVICE_NAME) //
@@ -182,7 +181,8 @@
         service = new Service(SERVICE_NAME, keepAliveInterval, "callbackUrl");
         services.put(service);
 
-        policies = new Policies();
+        ApplicationConfig appConfig = new ApplicationConfig();
+        policies = new Policies(appConfig);
         policies.put(policy);
     }
 }
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1Client.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1Client.java
index 482fa39..22ac243 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1Client.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1Client.java
@@ -20,12 +20,16 @@
 
 package org.onap.ccsdk.oran.a1policymanagementservice.utils;
 
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
 import java.nio.charset.StandardCharsets;
 import java.time.Duration;
 import java.util.List;
 import java.util.Vector;
 
 import org.onap.ccsdk.oran.a1policymanagementservice.clients.A1Client;
+import org.onap.ccsdk.oran.a1policymanagementservice.configuration.ApplicationConfig;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policy;
 import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyType;
@@ -38,20 +42,23 @@
 import reactor.core.publisher.MonoSink;
 
 public class MockA1Client implements A1Client {
-    Policies policies = new Policies();
+    Policies policies;
     private final PolicyTypes policyTypes;
     private final Duration asynchDelay;
 
-    public MockA1Client(PolicyTypes policyTypes, Duration asynchDelay) {
+    public MockA1Client(String ricId, ApplicationConfig appConfig, PolicyTypes policyTypes, Duration asynchDelay) {
         this.policyTypes = policyTypes;
         this.asynchDelay = asynchDelay;
+        ApplicationConfig cfg = spy(appConfig);
+        when(cfg.getVardataDirectory()).thenReturn(null);
+        this.policies = new Policies(cfg);
     }
 
     @Override
     public Mono<List<String>> getPolicyTypeIdentities() {
         List<String> result = new Vector<>();
         for (PolicyType p : this.policyTypes.getAll()) {
-            result.add(p.id());
+            result.add(p.getId());
         }
         return mono(result);
     }
@@ -60,7 +67,7 @@
     public Mono<List<String>> getPolicyIdentities() {
         Vector<String> result = new Vector<>();
         for (Policy policy : policies.getAll()) {
-            result.add(policy.id());
+            result.add(policy.getId());
         }
 
         return mono(result);
@@ -69,7 +76,7 @@
     @Override
     public Mono<String> getPolicyTypeSchema(String policyTypeId) {
         try {
-            return mono(this.policyTypes.getType(policyTypeId).schema());
+            return mono(this.policyTypes.getType(policyTypeId).getSchema());
         } catch (Exception e) {
             return Mono.error(e);
         }
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java
index d474daa..05df70a 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java
@@ -20,7 +20,6 @@
 
 package org.onap.ccsdk.oran.a1policymanagementservice.utils;
 
-import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 
 import java.lang.invoke.MethodHandles;
@@ -42,10 +41,12 @@
     private final Map<String, MockA1Client> clients = new HashMap<>();
     private PolicyTypes policyTypes;
     private Duration asynchDelay = Duration.ofSeconds(0);
+    private final ApplicationConfig appConfig;
 
-    public MockA1ClientFactory(PolicyTypes policyTypes) {
-        super(mock(ApplicationConfig.class));
+    public MockA1ClientFactory(ApplicationConfig config, PolicyTypes policyTypes) {
+        super(config);
         this.policyTypes = policyTypes;
+        this.appConfig = config;
     }
 
     @Override
@@ -56,7 +57,7 @@
     public MockA1Client getOrCreateA1Client(String ricId) {
         if (!clients.containsKey(ricId)) {
             logger.debug("Creating client for RIC: {}", ricId);
-            MockA1Client client = spy(new MockA1Client(policyTypes, asynchDelay));
+            MockA1Client client = spy(new MockA1Client(ricId, appConfig, policyTypes, asynchDelay));
             clients.put(ricId, client);
         }
         return clients.get(ricId);
diff --git a/docs/offeredapis/swagger/pms-api.json b/docs/offeredapis/swagger/pms-api.json
index 9514f7e..5b43282 100644
--- a/docs/offeredapis/swagger/pms-api.json
+++ b/docs/offeredapis/swagger/pms-api.json
@@ -440,11 +440,11 @@
                 "tags": ["A1 Policy Management V1.0"]
             },
             "delete": {
-                "summary": "Delete a service",
+                "summary": "Unregisters a service",
                 "operationId": "deleteService",
                 "responses": {
                     "204": {
-                        "description": "Service deleted",
+                        "description": "Service unregisterred",
                         "content": {"*/*": {"schema": {"$ref": "#/components/schemas/void"}}}
                     },
                     "404": {
diff --git a/docs/offeredapis/swagger/pms-api.yaml b/docs/offeredapis/swagger/pms-api.yaml
index d16fbe5..cdf91ee 100644
--- a/docs/offeredapis/swagger/pms-api.yaml
+++ b/docs/offeredapis/swagger/pms-api.yaml
@@ -159,7 +159,7 @@
     delete:
       tags:
       - A1 Policy Management V1.0
-      summary: Delete a service
+      summary: Unregisters a service
       operationId: deleteService
       parameters:
       - name: name
@@ -172,7 +172,7 @@
           type: string
       responses:
         204:
-          description: Service deleted
+          description: Service unregisterred
           content:
             '*/*':
               schema:
