diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
index 52aa22b..52f3c0f 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
@@ -22,13 +22,13 @@
 import java.io.PrintWriter;
 import java.lang.reflect.Array;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.SortedMap;
 import java.util.StringTokenizer;
@@ -504,7 +504,7 @@
     }
 
 
-    private void addMetaTypeNames( final Map pidMap, final Collection ocdCollection, final String filterSpec, final String type )
+    private void addMetaTypeNames( final Map pidMap, final Map ocdCollection, final String filterSpec, final String type )
     {
         Filter filter = null;
         if ( filterSpec != null )
@@ -519,16 +519,24 @@
             }
         }
 
-        for ( Iterator oci = ocdCollection.iterator(); oci.hasNext(); )
+        for ( Iterator oci = ocdCollection.entrySet().iterator(); oci.hasNext(); )
         {
-            final ObjectClassDefinition ocd = ( ObjectClassDefinition ) oci.next();
-            final String pid = ocd.getID();
-            final Dictionary props = new Hashtable();
-            props.put( type, pid );
-            if ( filter == null || filter.match( props ) )
+            final Entry ociEntry = (Entry) oci.next();
+            final String pid = (String) ociEntry.getKey();
+            final ObjectClassDefinition ocd = ( ObjectClassDefinition ) ociEntry.getValue();
+            if ( filter == null )
             {
                 pidMap.put( pid, ocd.getName() );
             }
+            else
+            {
+                final Dictionary props = new Hashtable();
+                props.put( type, pid );
+                if ( filter.match( props ) )
+                {
+                    pidMap.put( pid, ocd.getName() );
+                }
+            }
         }
 
     }
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
index 493ff99..525dd2e 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
@@ -17,8 +17,6 @@
 package org.apache.felix.webconsole.internal.compendium;
 
 
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -75,11 +73,11 @@
      * the MetaType information for that PID.
      *
      * @param locale The name of the locale to get the meta data for.
-     * @return see the method description 
+     * @return see the method description
      */
-    protected Collection getPidObjectClasses( final String locale )
+    protected Map getPidObjectClasses( final String locale )
     {
-        return getObjectClasses( PID_GETTER, locale );
+        return getObjectClassDefinitions( PID_GETTER, locale );
     }
 
 
@@ -90,11 +88,11 @@
      * PID.
      *
      * @param locale The name of the locale to get the meta data for.
-     * @return see the method description 
+     * @return see the method description
      */
-    protected Collection getFactoryPidObjectClasses( final String locale )
+    protected Map getFactoryPidObjectClasses( final String locale )
     {
-        return getObjectClasses( FACTORY_PID_GETTER, locale );
+        return getObjectClassDefinitions( FACTORY_PID_GETTER, locale );
     }
 
 
@@ -108,10 +106,12 @@
      *          or PIDs from <code>MetaTypeInformation</code> objects.
      * @param locale The name of the locale to get the object class definitions
      *          for.
+     * @return Map of <code>ObjectClassDefinition</code> objects indexed by the
+     *      PID (or factory PID) to which they pertain
      */
-    private Collection getObjectClasses( final IdGetter idGetter, final String locale )
+    private Map getObjectClassDefinitions( final IdGetter idGetter, final String locale )
     {
-        final Collection objectClasses = new ArrayList();
+        final Map objectClassesDefinitions = new HashMap();
         final MetaTypeService mts = this.getMetaTypeService();
         if ( mts != null )
         {
@@ -124,13 +124,13 @@
                     final String[] idList = idGetter.getIds( mti );
                     for ( int j = 0; idList != null && j < idList.length; j++ )
                     {
-                        // After getting the list of PIDs, a configuration  might be 
+                        // After getting the list of PIDs, a configuration  might be
                         // removed. So the getObjectClassDefinition will throw
                         // an exception, and this will prevent ALL configuration from
                         // being displayed. By catching it, the configurations will be
                         // visible
                         ObjectClassDefinition ocd = null;
-                        try 
+                        try
                         {
                             ocd = mti.getObjectClassDefinition( idList[j], locale );
                         }
@@ -140,13 +140,13 @@
                         }
                         if ( ocd != null )
                         {
-                            objectClasses.add( ocd );
+                            objectClassesDefinitions.put( idList[j], ocd );
                         }
                     }
                 }
             }
         }
-        return objectClasses;
+        return objectClassesDefinitions;
     }
 
 
