diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
index 27f375d..805dfd0 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. 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.
@@ -45,8 +45,6 @@
 import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
 import org.onap.policy.common.utils.coder.StandardCoderObject;
 import org.onap.policy.common.utils.network.NetworkUtil;
-import org.onap.policy.drools.controller.DroolsController;
-import org.onap.policy.drools.controller.DroolsControllerConstants;
 import org.onap.policy.drools.persistence.SystemPersistenceConstants;
 import org.onap.policy.drools.system.PolicyController;
 import org.onap.policy.models.pdp.concepts.PdpResponseDetails;
@@ -70,7 +68,6 @@
     protected static final String CONFIGURATION_PROPERTIES_NAME = "feature-lifecycle";
     protected static final String GROUP_NAME = "lifecycle.pdp.group";
     protected static final String DEFAULT_PDP_GROUP = "defaultGroup";
-    protected static final String POLICY_TYPE_VERSION = "1.0.0";
     protected static final long DEFAULT_STATUS_TIMER_SECONDS = 120L;
     protected static final long MIN_STATUS_INTERVAL_SECONDS = 5L;
     protected static final String PDP_MESSAGE_NAME = "messageName";
@@ -112,6 +109,7 @@
     @Getter
     protected String subgroup;
 
+    @Getter
     protected final Map<ToscaPolicyTypeIdentifier, PolicyController> policyTypesMap = new HashMap<>();
 
     protected final Map<ToscaPolicyIdentifier, ToscaPolicy> policiesMap = new HashMap<>();
@@ -150,7 +148,9 @@
     public synchronized void start(@NonNull PolicyController controller) {
         logger.info("lifecycle event: start controller: {}", controller.getName());
         for (ToscaPolicyTypeIdentifier id : controller.getPolicyTypes()) {
-            policyTypesMap.put(id, controller);
+            if (isToscaPolicyType(id.getName())) {
+                policyTypesMap.put(id, controller);
+            }
         }
     }
 
@@ -342,7 +342,6 @@
         status.setState(state);
         status.setHealthy(isAlive() ? PdpHealthStatus.HEALTHY : PdpHealthStatus.NOT_HEALTHY);
         status.setPdpType("drools");
-        status.setSupportedPolicyTypes(getCapabilities());
         status.setPolicies(new ArrayList<>(policiesMap.keySet()));
         return status;
     }
@@ -379,23 +378,9 @@
         return this.client.getSink().start();
     }
 
-    private List<ToscaPolicyTypeIdentifier> getCapabilities() {
-        List<ToscaPolicyTypeIdentifier> capabilities = new ArrayList<>();
-        for (DroolsController dc : DroolsControllerConstants.getFactory().inventory()) {
-            if (!dc.isBrained()) {
-                continue;
-            }
-
-            for (String domain : dc.getBaseDomainNames()) {
-                // HACK: until legacy controllers are removed
-                if (StringUtils.countMatches(domain, ".") > 1) {
-                    capabilities.add(new ToscaPolicyTypeIdentifier(domain, POLICY_TYPE_VERSION));
-                } else {
-                    logger.info("legacy controller {} with domain {}", dc.getCanonicalSessionNames(), domain);
-                }
-            }
-        }
-        return capabilities;
+    protected boolean isToscaPolicyType(String domain) {
+        // HACK: until legacy controllers support is removed
+        return StringUtils.countMatches(domain, ".") > 1;
     }
 
     protected boolean isItMe(String name, String group, String subgroup) {
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java
index 78414fe..a80c885 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019 Bell Canada.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -80,7 +80,11 @@
     @Override
     public boolean status() {
         synchronized (fsm) {
-            return fsm.statusAction();
+            if (fsm.getPolicyTypesMap().isEmpty()) {
+                return true;
+            } else {
+                return fsm.statusAction();
+            }
         }
     }
 
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java
index bb8e494..2a25830 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. 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.
@@ -34,7 +34,6 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
-import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 import org.junit.Before;
 import org.junit.Test;
@@ -44,7 +43,6 @@
 import org.onap.policy.models.pdp.concepts.PdpStateChange;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
-import org.onap.policy.models.pdp.enums.PdpMessageType;
 import org.onap.policy.models.pdp.enums.PdpState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 
@@ -127,28 +125,19 @@
         assertTrue(fsm.statusTask.isDone());
     }
 
-    private Callable<Boolean> isStatus(PdpState state) {
-        return () -> {
-            if (fsm.client.getSink().getRecentEvents().length == 0) {
-                return false;
-            }
-
-            List<String> events = Arrays.asList(fsm.client.getSink().getRecentEvents());
-            PdpStatus status =
-                new StandardCoder().decode(events.get(events.size() - 1), PdpStatus.class);
-
-            return status.getMessageName() == PdpMessageType.PDP_STATUS && state == status.getState();
-        };
-    }
-
     @Test
     public void status() {
         waitUntil(fsm.getStatusTimerSeconds() + 1, TimeUnit.SECONDS, isStatus(PdpState.ACTIVE));
         int preCount = fsm.client.getSink().getRecentEvents().length;
 
         assertTrue(fsm.status());
+        assertEquals(preCount, fsm.client.getSink().getRecentEvents().length);
+
+        fsm.start(controllerSupport.getController());
+        assertTrue(fsm.status());
         assertEquals(preCount + 1, fsm.client.getSink().getRecentEvents().length);
 
+        fsm.stop(controllerSupport.getController());
         fsm.shutdown();
     }
 
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java
index 341d985..f242e4c 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. 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.
@@ -33,7 +33,6 @@
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 import org.junit.Before;
 import org.junit.Test;
@@ -94,23 +93,6 @@
         fsm.shutdown();
     }
 
-    private Callable<Boolean> isStatus(PdpState state, int count) {
-        return () -> {
-            if (!fsm.client.getSink().isAlive()) {
-                return false;
-            }
-
-            if (fsm.client.getSink().getRecentEvents().length != count) {
-                return false;
-            }
-
-            String[] events = fsm.client.getSink().getRecentEvents();
-            PdpStatus status = new StandardCoder().decode(events[events.length - 1], PdpStatus.class);
-
-            return status.getMessageName() == PdpMessageType.PDP_STATUS && state == status.getState();
-        };
-    }
-
     @Test
     public void stop() {
         simpleStop();
@@ -137,19 +119,23 @@
 
     @Test
     public void status() {
-        status(PdpState.PASSIVE);
+        assertTrue(fsm.client.getSink().isAlive());
+        assertTrue(fsm.status());
+        assertSame(0, fsm.client.getSink().getRecentEvents().length);
+
+
+        fsm.start(controllerSupport.getController());
+        status(PdpState.PASSIVE, 1);
+        fsm.stop(controllerSupport.getController());
         fsm.shutdown();
     }
 
-    private void status(PdpState state) {
-        waitUntil(5, TimeUnit.SECONDS, isStatus(state, 1));
-
-        waitUntil(fsm.statusTimerSeconds + 2, TimeUnit.SECONDS, isStatus(state, 2));
-
-        waitUntil(fsm.statusTimerSeconds + 2, TimeUnit.SECONDS, isStatus(state, 3));
-
+    private void status(PdpState state, int initial) {
+        waitUntil(5, TimeUnit.SECONDS, isStatus(state, initial));
+        waitUntil(fsm.statusTimerSeconds + 2, TimeUnit.SECONDS, isStatus(state, initial + 1));
+        waitUntil(fsm.statusTimerSeconds + 2, TimeUnit.SECONDS, isStatus(state, initial + 2));
         assertTrue(fsm.status());
-        waitUntil(200, TimeUnit.MILLISECONDS, isStatus(state, 4));
+        waitUntil(200, TimeUnit.MILLISECONDS, isStatus(state, initial + 3));
     }
 
     @Test
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java
index b5b5976..fe3566d 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. 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.
@@ -28,10 +28,14 @@
 import java.util.concurrent.TimeUnit;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.time.PseudoScheduledExecutorService;
 import org.onap.policy.common.utils.time.TestTimeMulti;
 import org.onap.policy.drools.persistence.SystemPersistenceConstants;
 import org.onap.policy.drools.utils.logging.LoggerUtil;
+import org.onap.policy.models.pdp.concepts.PdpStatus;
+import org.onap.policy.models.pdp.enums.PdpMessageType;
+import org.onap.policy.models.pdp.enums.PdpState;
 
 public abstract class LifecycleStateRunningTest {
 
@@ -84,4 +88,25 @@
     public void waitUntil(long twait, TimeUnit units, Callable<Boolean> condition) {
         time.waitUntil(twait, units, condition);
     }
+
+    protected Callable<Boolean> isStatus(PdpState state, int count) {
+        return () -> {
+            if (fsm.client.getSink().getRecentEvents().length != count) {
+                return false;
+            }
+
+            String[] events = fsm.client.getSink().getRecentEvents();
+            PdpStatus status = new StandardCoder().decode(events[events.length - 1], PdpStatus.class);
+
+            if (status.getSupportedPolicyTypes() != null) {
+                return false;
+            }
+
+            return status.getMessageName() == PdpMessageType.PDP_STATUS && state == status.getState();
+        };
+    }
+
+    protected Callable<Boolean> isStatus(PdpState state) {
+        return isStatus(state, fsm.client.getSink().getRecentEvents().length);
+    }
 }
