diff --git a/main/src/main/java/org/apache/felix/main/AutoActivator.java b/main/src/main/java/org/apache/felix/main/AutoProcessor.java
similarity index 91%
rename from main/src/main/java/org/apache/felix/main/AutoActivator.java
rename to main/src/main/java/org/apache/felix/main/AutoProcessor.java
index 7d502de..1a3f926 100644
--- a/main/src/main/java/org/apache/felix/main/AutoActivator.java
+++ b/main/src/main/java/org/apache/felix/main/AutoProcessor.java
@@ -23,7 +23,7 @@
 import org.osgi.framework.*;
 import org.osgi.service.startlevel.*;
 
-public class AutoActivator implements BundleActivator
+public class AutoProcessor
 {
     /**
      * The property name used for the bundle directory.
@@ -62,32 +62,16 @@
     **/
     public static final String AUTO_START_PROP = "felix.auto.start";
 
-    private final Map m_configMap;
-
-    public AutoActivator(Map configMap)
-    {
-        m_configMap = configMap;
-    }
-
     /**
-     * Used to instigate auto-install and auto-start configuration
-     * property processing via a custom framework activator during
-     * framework startup.
+     * Used to instigate auto-deploy directory process and auto-install/auto-start
+     * configuration property processing during.
+     * @param configMap Map of configuration properties.
      * @param context The system bundle context.
     **/
-    public void start(BundleContext context)
+    public static void process(Map configMap, BundleContext context)
     {
-        processAutoDeploy(context);
-        processAutoProperties(context);
-    }
-
-    /**
-     * Currently does nothing as part of framework shutdown.
-     * @param context The system bundle context.
-    **/
-    public void stop(BundleContext context)
-    {
-        // Do nothing.
+        processAutoDeploy(configMap, context);
+        processAutoProperties(configMap, context);
     }
 
     /**
@@ -96,10 +80,10 @@
      * starting each one.
      * </p>
      */
-    private void processAutoDeploy(BundleContext context)
+    private static void processAutoDeploy(Map configMap, BundleContext context)
     {
         // Determine if auto deploy actions to perform.
-        String action = (String) m_configMap.get(AUTO_DEPLOY_ACTION_PROPERY);
+        String action = (String) configMap.get(AUTO_DEPLOY_ACTION_PROPERY);
         action = (action == null) ? "" : action;
         List actionList = new ArrayList();
         StringTokenizer st = new StringTokenizer(action, ",");
@@ -127,7 +111,7 @@
             }
 
             // Get the auto deploy directory.
-            String autoDir = (String) m_configMap.get(AUTO_DEPLOY_DIR_PROPERY);
+            String autoDir = (String) configMap.get(AUTO_DEPLOY_DIR_PROPERY);
             autoDir = (autoDir == null) ? AUTO_DEPLOY_DIR_VALUE : autoDir;
             // Look in the specified bundle directory to create a list
             // of all JAR files to install.
@@ -236,7 +220,7 @@
      * specified configuration properties.
      * </p>
      */
-    private void processAutoProperties(BundleContext context)
+    private static void processAutoProperties(Map configMap, BundleContext context)
     {
         // Retrieve the Start Level service, since it will be needed
         // to set the start level of the installed bundles.
@@ -252,7 +236,7 @@
         // property name, where "n" is the desired start level for the list
         // of bundles. If no start level is specified, the default start
         // level is assumed.
-        for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
+        for (Iterator i = configMap.keySet().iterator(); i.hasNext(); )
         {
             String key = ((String) i.next()).toLowerCase();
 
@@ -279,7 +263,7 @@
             }
 
             // Parse and install the bundles associated with the key.
-            StringTokenizer st = new StringTokenizer((String) m_configMap.get(key), "\" ", true);
+            StringTokenizer st = new StringTokenizer((String) configMap.get(key), "\" ", true);
             for (String location = nextLocation(st); location != null; location = nextLocation(st))
             {
                 try
@@ -296,12 +280,12 @@
         }
 
         // Now loop through the auto-start bundles and start them.
-        for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
+        for (Iterator i = configMap.keySet().iterator(); i.hasNext(); )
         {
             String key = ((String) i.next()).toLowerCase();
             if (key.startsWith(AUTO_START_PROP))
             {
-                StringTokenizer st = new StringTokenizer((String) m_configMap.get(key), "\" ", true);
+                StringTokenizer st = new StringTokenizer((String) configMap.get(key), "\" ", true);
                 for (String location = nextLocation(st); location != null; location = nextLocation(st))
                 {
                     // Installing twice just returns the same bundle.
diff --git a/main/src/main/java/org/apache/felix/main/Main.java b/main/src/main/java/org/apache/felix/main/Main.java
index 6cfa7b7..1d86312 100644
--- a/main/src/main/java/org/apache/felix/main/Main.java
+++ b/main/src/main/java/org/apache/felix/main/Main.java
@@ -22,11 +22,10 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.*;
-import org.apache.felix.framework.Felix;
-import org.apache.felix.framework.util.FelixConstants;
 import org.apache.felix.framework.util.Util;
 import org.osgi.framework.Constants;
 import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
 
 /**
  * <p>
@@ -67,7 +66,7 @@
      */
     public static final String CONFIG_DIRECTORY = "conf";
 
-    private static Framework m_felix = null;
+    private static Framework m_fwk = null;
 
     /**
      * <p>
@@ -219,7 +218,7 @@
         // that overwrites anything in the config file.
         if (bundleDir != null)
         {
-            configProps.setProperty(AutoActivator.AUTO_DEPLOY_DIR_PROPERY, bundleDir);
+            configProps.setProperty(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, bundleDir);
         }
 
         // If there is a passed in bundle cache directory, then
@@ -229,25 +228,24 @@
             configProps.setProperty(Constants.FRAMEWORK_STORAGE, cacheDir);
         }
 
-        // Create a list for custom framework activators and
-        // add an instance of the auto-activator it for processing
-        // auto-install and auto-start properties. Add this list
-        // to the configuration properties.
-        List list = new ArrayList();
-        list.add(new AutoActivator(configProps));
-        configProps.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
-
         // Print welcome banner.
         System.out.println("\nWelcome to Felix.");
         System.out.println("=================\n");
 
         try
         {
-            // Create an instance and start the framework.
-            m_felix = new Felix(configProps);
-            m_felix.start();
+            // Create an instance of the framework.
+            FrameworkFactory factory = getFrameworkFactory();
+            m_fwk = factory.newFramework(configProps);
+            // Initialize the framework, but don't start it yet.
+            m_fwk.init();
+            // Use the system bundle context to process the auto-deploy
+            // and auto-install/auto-start properties.
+            AutoProcessor.process(configProps, m_fwk.getBundleContext());
+            // Start the framework.
+            m_fwk.start();
             // Wait for framework to stop to exit the VM.
-            m_felix.waitForStop(0);
+            m_fwk.waitForStop(0);
             System.exit(0);
         }
         catch (Exception ex)
@@ -259,6 +257,41 @@
     }
 
     /**
+     * Simple method to parse META-INF/services file for framework factory.
+     * Currently, it assumes the first non-commented line is the class name
+     * of the framework factory implementation.
+     * @return The created <tt>FrameworkFactory</tt> instance.
+     * @throws Exception if any errors occur.
+    **/
+    private static FrameworkFactory getFrameworkFactory() throws Exception
+    {
+        URL url = Main.class.getClassLoader().getResource(
+            "META-INF/services/org.osgi.framework.launch.FrameworkFactory");
+        if (url != null)
+        {
+            BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+            try
+            {
+                for (String s = br.readLine(); s != null; s = br.readLine())
+                {
+                    s = s.trim();
+                    // Try to load first non-empty, non-commented line.
+                    if ((s.length() > 0) && (s.charAt(0) != '#'))
+                    {
+                        return (FrameworkFactory) Class.forName(s).newInstance();
+                    }
+                }
+            }
+            finally
+            {
+                if (br != null) br.close();
+            }
+        }
+
+        throw new Exception("Could not find framework factory.");
+    }
+
+    /**
      * <p>
      * Loads the properties in the system property file associated with the
      * framework installation into <tt>System.setProperty()</tt>. These properties
