diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
index 8be9066..4e4aacc 100644
--- a/addressbook/Makefile.am
+++ b/addressbook/Makefile.am
@@ -1,6 +1,5 @@
 AM_CPPFLAGS = \
 	-I$(top_srcdir) \
-	-I$(top_srcdir)/storage \
 	-DG_LOG_DOMAIN=\"e-book-backend-exchange\" \
 	$(ADDRESSBOOK_CFLAGS) \
 	$(LIBEXCHANGE_CFLAGS) \
@@ -44,9 +43,6 @@ libexchangeaddressbook_la_SOURCES = \
 	e-book-backend-exchange.c \
 	e-book-backend-exchange.h \
 	e-book-backend-exchange-factory.c \
-	e-book-backend-exchange-factory.h \
-	e-book-backend-gal-factory.c \
-	e-book-backend-gal-factory.h \
 	e-book-backend-gal.c \
 	e-book-backend-gal.h
 
@@ -55,7 +51,8 @@ libexchangeaddressbook_la_SOURCES += \
 	e-book-backend-db-cache.c \
 	e-book-backend-db-cache.h
 
-libexchangeaddressbook_la_LIBADD =  \
+libebookbackendexchange_la_LIBADD =  				\
+	$(top_builddir)/tools/libevolution-exchange-shared.la	\
 	$(DB_LIBS)
 
 libexchangeaddressbook_la_LDFLAGS = \
diff --git a/addressbook/e-book-backend-exchange-factory.c b/addressbook/e-book-backend-exchange-factory.c
index 3b8716a..b345f74 100644
--- a/addressbook/e-book-backend-exchange-factory.c
+++ b/addressbook/e-book-backend-exchange-factory.c
@@ -24,53 +24,36 @@
 #include <pthread.h>
 #include <string.h>
 
-#include "e-book-backend-exchange-factory.h"
+#include <libedata-book/e-book-backend-factory.h>
+#include <camel/camel-object.h>
+
 #include "e-book-backend-exchange.h"
+#include "e-book-backend-gal.h"
 
-static void
-e_book_backend_exchange_factory_instance_init (EBookBackendExchangeFactory *factory)
-{
-}
+E_BOOK_BACKEND_FACTORY_SIMPLE (exchange, Exchange, e_book_backend_exchange_new)
+E_BOOK_BACKEND_FACTORY_SIMPLE (gal, Gal, e_book_backend_gal_new)
 
-static const gchar *
-_get_protocol (EBookBackendFactory *factory)
-{
-	return "exchange";
-}
+static GType exchange_types[2];
 
-static EBookBackend*
-_new_backend (EBookBackendFactory *factory)
+void
+eds_module_initialize (GTypeModule *type_module)
 {
-	return e_book_backend_exchange_new ();
+	/* to have a camel type initialized properly */
+	camel_type_init ();
+	camel_object_get_type ();
+
+	exchange_types[0] = _exchange_factory_get_type (type_module);
+	exchange_types[1] = _gal_factory_get_type (type_module);
 }
 
-static void
-e_book_backend_exchange_factory_class_init (EBookBackendExchangeFactoryClass *klass)
+void
+eds_module_shutdown (void)
 {
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->new_backend = _new_backend;
 }
 
-GType
-e_book_backend_exchange_factory_get_type (void)
+void
+eds_module_list_types (const GType **types, gint *num_types)
 {
-	static GType  type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (EBookBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  e_book_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (EBookBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_book_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_BOOK_BACKEND_FACTORY,
-					       "EBookBackendExchangeFactory", &info, 0);
-	}
-	return type;
+	*types = exchange_types;
+	*num_types = G_N_ELEMENTS (exchange_types);
 }
diff --git a/addressbook/e-book-backend-exchange.c b/addressbook/e-book-backend-exchange.c
index 99c1d62..b733f08 100644
--- a/addressbook/e-book-backend-exchange.c
+++ b/addressbook/e-book-backend-exchange.c
@@ -58,8 +58,9 @@
 #include <exchange-hierarchy.h>
 #include <exchange-esource.h>
 #include <e-folder-exchange.h>
+
+#include "tools/exchange-share-config-listener.h"
 #include "e-book-backend-exchange.h"
-#include "exchange-component.h"
 
 #define DEBUG
 #define d(x)
@@ -692,7 +693,7 @@ e_book_backend_exchange_connect (EBookBackendExchange *be)
 	time_t folder_mtime;
 
 	if (!bepriv->account) {
-		bepriv->account = exchange_component_get_account_for_uri (global_exchange_component, bepriv->exchange_uri);
+		bepriv->account = exchange_share_config_listener_get_account_for_uri (NULL, bepriv->exchange_uri);
 		if (!bepriv->account)
 			return GNOME_Evolution_Addressbook_RepositoryOffline;
 	}
@@ -2303,7 +2304,7 @@ e_book_backend_exchange_start_book_view (EBookBackend  *backend,
 
 	d(printf("ebbe_start_book_view(%p, %p)\n", backend, book_view));
 
-	bonobo_object_ref (book_view);
+	e_data_book_view_ref (book_view);
 	e_data_book_view_notify_status_message (book_view, _("Searching..."));
 
 	switch (bepriv->mode) {
@@ -2344,16 +2345,15 @@ e_book_backend_exchange_start_book_view (EBookBackend  *backend,
 					GNOME_Evolution_Addressbook_Success);
 		if (temp_list)
 			 g_list_free (temp_list);
-		bonobo_object_unref (book_view);
+		e_data_book_view_unref (book_view);
 		return;
 
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
 		if (!be->priv->ctx) {
 			e_book_backend_notify_auth_required (backend);
-			e_data_book_view_notify_complete (book_view,
-						GNOME_Evolution_Addressbook_AuthenticationRequired);
-			bonobo_object_unref (book_view);
+			e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_AuthenticationRequired);
+			e_data_book_view_unref (book_view);
 			return;
 		}
 
@@ -2381,9 +2381,8 @@ e_book_backend_exchange_start_book_view (EBookBackend  *backend,
 		}
 		status = e2k_result_iter_free (iter);
 
-		e_data_book_view_notify_complete (book_view,
-						  http_status_to_pas (status));
-		bonobo_object_unref (book_view);
+		e_data_book_view_notify_complete (book_view, http_status_to_pas (status));
+		e_data_book_view_unref (book_view);
 
 		/* also update the folder list */
 		exchange_account_rescan_tree (bepriv->account);
@@ -2650,7 +2654,7 @@ e_book_backend_exchange_authenticate_user (EBookBackend *backend,
 	EBookBackendExchange *be = E_BOOK_BACKEND_EXCHANGE (backend);
 	EBookBackendExchangePrivate *bepriv = be->priv;
 	ExchangeAccountResult result;
-	ExchangeAccount *account;
+	ExchangeAccount *account = NULL;
 
 	d(printf("ebbe_authenticate_user(%p, %p, %s, %s, %s)\n", backend, book, user, password, auth_method));
 
@@ -2664,7 +2668,7 @@ e_book_backend_exchange_authenticate_user (EBookBackend *backend,
 
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
-		bepriv->account = account = exchange_component_get_account_for_uri (global_exchange_component, NULL);
+		bepriv->account = account = exchange_share_config_listener_get_account_for_uri (NULL, bepriv->exchange_uri);
 		/* FIXME : Check for failures */
 		if (!(bepriv->ctx = exchange_account_get_context (account))) {
 			exchange_account_set_online (account);
@@ -2828,12 +2832,12 @@ e_book_backend_exchange_remove (EBookBackendSync *backend, EDataBook *book, guin
 	if (int_uri)
 		result = exchange_account_remove_folder (bepriv->account, int_uri);
 	else {
-		ExchangeAccount *account;
+		ExchangeAccount *account = NULL;
 
 		/* internal URI is NULL, mostly the case where folder doesn't exists anymore
 		 * in the server, update the gconf sources.
 		 */
-		account = exchange_component_get_account_for_uri (global_exchange_component, NULL);
+		account = exchange_share_config_listener_get_account_for_uri (NULL, bepriv->exchange_uri);
 		if (exchange_account_get_context (account)) {
 			remove_folder_esource (account, EXCHANGE_CONTACTS_FOLDER, bepriv->exchange_uri);
 			result = EXCHANGE_ACCOUNT_FOLDER_OK;
@@ -2876,7 +2880,7 @@ e_book_backend_exchange_set_mode (EBookBackend *backend, gint mode)
 {
 	EBookBackendExchange *be = E_BOOK_BACKEND_EXCHANGE (backend);
 	EBookBackendExchangePrivate *bepriv = be->priv;
-	ExchangeAccount *account;
+	ExchangeAccount *account = NULL;
 
 	bepriv->mode = mode;
 	/* if (e_book_backend_is_loaded (backend)) { */
@@ -2889,7 +2893,7 @@ e_book_backend_exchange_set_mode (EBookBackend *backend, gint mode)
 		e_book_backend_set_is_writable (backend, bepriv->is_writable);
 		e_book_backend_notify_writable (backend, bepriv->is_writable);
 		e_book_backend_notify_connection_status (backend, TRUE);
-		account = exchange_component_get_account_for_uri (global_exchange_component, NULL);
+		account = exchange_share_config_listener_get_account_for_uri (NULL, bepriv->exchange_uri);
 		if (!exchange_account_get_context (account))
 			e_book_backend_notify_auth_required (backend);
 	}
@@ -2908,6 +2912,8 @@ e_book_backend_exchange_new (void)
 {
 	EBookBackendExchange *backend;
 
+	exchange_share_config_listener_get_account_for_uri (NULL, NULL);
+
 	backend = g_object_new (e_book_backend_exchange_get_type (), NULL);
 
 	if (! e_book_backend_exchange_construct (backend)) {
diff --git a/addressbook/e-book-backend-gal-factory.c b/addressbook/e-book-backend-gal-factory.c
index e5bc757..e69de29 100644
--- a/addressbook/e-book-backend-gal-factory.c
+++ b/addressbook/e-book-backend-gal-factory.c
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2002-2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pthread.h>
-#include <string.h>
-
-#include "e-book-backend-gal-factory.h"
-#include "e-book-backend-gal.h"
-
-static void
-e_book_backend_gal_factory_instance_init (EBookBackendGalFactory *factory)
-{
-}
-
-static const gchar *
-_get_protocol (EBookBackendFactory *factory)
-{
-	return "gal";
-}
-
-static EBookBackend*
-_new_backend (EBookBackendFactory *factory)
-{
-	return e_book_backend_gal_new ();
-}
-
-static void
-e_book_backend_gal_factory_class_init (EBookBackendGalFactoryClass *klass)
-{
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->new_backend = _new_backend;
-}
-
-GType
-e_book_backend_gal_factory_get_type (void)
-{
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (EBookBackendGalFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  e_book_backend_gal_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (EBookBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_book_backend_gal_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_BOOK_BACKEND_FACTORY,
-					       "EBookBackendGalFactory", &info, 0);
-	}
-	return type;
-}
diff --git a/addressbook/e-book-backend-gal-factory.h b/addressbook/e-book-backend-gal-factory.h
index b794395..e69de29 100644
--- a/addressbook/e-book-backend-gal-factory.h
+++ b/addressbook/e-book-backend-gal-factory.h
@@ -1,50 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* e-book-backend-gal-factory.h
- *
- * Copyright (C) 2004  Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _E_BOOK_BACKEND_GAL_FACTORY_H_
-#define _E_BOOK_BACKEND_GAL_FACTORY_H_
-
-#include <glib-object.h>
-#include <libedata-book/e-book-backend-factory.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_BOOK_BACKEND_GAL_FACTORY        (e_book_backend_gal_factory_get_type ())
-#define E_BOOK_BACKEND_GAL_FACTORY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_BACKEND_GAL_FACTORY, EBookBackendGalFactory))
-#define E_BOOK_BACKEND_GAL_FACTORY_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_BACKEND_GAL_FACTORY, EBookBackendGalFactoryClass))
-#define E_IS_BOOK_BACKEND_GAL_FACTORY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_BACKEND_GAL_FACTORY))
-#define E_IS_BOOK_BACKEND_GAL_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_BACKEND_GAL_FACTORY))
-#define E_BOOK_BACKEND_GAL_FACTORY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_BACKEND_GAL_FACTORY, EBookBackendGalFactoryClass))
-
-typedef struct {
-	EBookBackendFactory            parent_object;
-} EBookBackendGalFactory;
-
-typedef struct {
-	EBookBackendFactoryClass parent_class;
-} EBookBackendGalFactoryClass;
-
-GType	e_book_backend_gal_factory_get_type (void);
-
-G_END_DECLS
-
-#endif /* _E_BOOK_BACKEND_GAL_FACTORY_H_ */
diff --git a/addressbook/e-book-backend-gal.c b/addressbook/e-book-backend-gal.c
index 2ee6746..4ab9b2c 100644
--- a/addressbook/e-book-backend-gal.c
+++ b/addressbook/e-book-backend-gal.c
@@ -35,7 +35,6 @@
 #include <e2k-utils.h>
 #include <e2k-global-catalog-ldap.h>
 #include <exchange-account.h>
-#include "exchange-component.h"
 
 #define d(x)
 
@@ -50,6 +49,7 @@
 #include <libedata-book/e-data-book.h>
 #include <libedata-book/e-data-book-view.h>
 #include "libedata-book/e-book-backend-summary.h"
+#include "tools/exchange-share-config-listener.h"
 #include "e-book-backend-gal.h"
 #include <libical/ical.h>
 
@@ -273,7 +273,7 @@ gal_connect (EBookBackendGAL *bl)
 	blpriv->gc = NULL;
 	blpriv->connected = FALSE;
 
-	blpriv->account = exchange_component_get_account_for_uri (global_exchange_component, blpriv->gal_uri);
+	blpriv->account = exchange_share_config_listener_get_account_for_uri (NULL, blpriv->gal_uri);
 	if (!blpriv->account)
 		return GNOME_Evolution_Addressbook_RepositoryOffline;
 	blpriv->gc = exchange_account_get_global_catalog (blpriv->account);
@@ -1733,7 +1733,7 @@ ldap_search_dtor (LDAPOp *op)
 	d(printf ("ldap_search_dtor: Setting null inplace of %p in view %p\n", op, search_op->view));
 	g_object_set_data (G_OBJECT (search_op->view), "EBookBackendGAL.BookView::search_op", NULL);
 
-	bonobo_object_unref (search_op->view);
+	e_data_book_view_unref (search_op->view);
 
 	if (!search_op->aborted)
 		g_free (search_op);
@@ -1945,7 +1945,7 @@ start_book_view (EBookBackend  *backend,
 				op->view = view;
 				op->aborted = FALSE;
 
-				bonobo_object_ref (view);
+				e_data_book_view_ref (view);
 
 				ldap_op_add ((LDAPOp*)op, E_BOOK_BACKEND (bl), NULL, view,
 					     0, search_msgid,
@@ -2347,7 +2347,7 @@ authenticate_user (EBookBackend *backend,
 	EBookBackendGAL *be = E_BOOK_BACKEND_GAL (backend);
 	EBookBackendGALPrivate *bepriv = be->priv;
 	ExchangeAccountResult result;
-	ExchangeAccount *account;
+	ExchangeAccount *account = NULL;
 	GNOME_Evolution_Addressbook_CallStatus res;
 	GConfClient *gc = gconf_client_get_default();
 	gint interval = gconf_client_get_int (gc, "/apps/evolution/addressbook/gal_cache_interval", NULL);
@@ -2370,7 +2370,7 @@ authenticate_user (EBookBackend *backend,
 
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
-		account = exchange_component_get_account_for_uri (global_exchange_component, NULL);
+		account = exchange_share_config_listener_get_account_for_uri (NULL, bepriv->gal_uri);
 		/* FIXME : Check for failures */
 		if (!exchange_account_get_context (account)) {
 			exchange_account_set_online (account);
diff --git a/addressbook/e-book-backend-gal.h b/addressbook/e-book-backend-gal.h
index 43ad2f3..e074afe 100644
--- a/addressbook/e-book-backend-gal.h
+++ b/addressbook/e-book-backend-gal.h
@@ -5,7 +5,6 @@
 #define __E_BOOK_BACKEND_GAL_H__
 
 #include "libedata-book/e-book-backend.h"
-#include "exchange-component.h"
 
 #ifdef SUNLDAP
 /*   copy from openldap ldap.h   */
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 6bb7f64..2453573 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -1,15 +1,14 @@
 AM_CPPFLAGS = \
 	-I$(top_srcdir) \
-	-I$(top_srcdir)/storage \
 	$(CALENDAR_CFLAGS) \
 	$(LIBEXCHANGE_CFLAGS) \
 	$(LDAP_CFLAGS) \
 	-DG_LOG_DOMAIN=\"e-cal-backend-exchange\"
 
 noinst_LTLIBRARIES = \
-        libexchangecalendar.la
+        libecalbackendexchange.la
 
-libexchangecalendar_la_SOURCES =  \
+libecalbackendexchange_la_SOURCES =  \
 	e-cal-backend-exchange.c \
 	e-cal-backend-exchange.h \
 	e-cal-backend-exchange-calendar.c \
@@ -23,4 +22,10 @@ libexchangecalendar_la_SOURCES =  \
 	e2k-cal-utils.c \
 	e2k-cal-utils.h
 
+libecalbackendexchange_la_LIBADD =  				\
+	$(top_builddir)/tools/libevolution-exchange-shared.la	\
+	$(CALENDAR_LIBS)					\
+	$(LIBEXCHANGE_LIBS)					\
+	$(LDAP_LIBS)
+
 -include $(top_srcdir)/git.mk
diff --git a/calendar/e-cal-backend-exchange-factory.c b/calendar/e-cal-backend-exchange-factory.c
index 3715e7c..724c1d1 100644
--- a/calendar/e-cal-backend-exchange-factory.c
+++ b/calendar/e-cal-backend-exchange-factory.c
@@ -24,14 +24,13 @@
 #include <pthread.h>
 #include <string.h>
 
+#include <camel/camel-object.h>
 #include "e-cal-backend-exchange-factory.h"
 #include "e-cal-backend-exchange-calendar.h"
 #include "e-cal-backend-exchange-tasks.h"
 
-static void
-e_cal_backend_exchange_factory_instance_init (ECalBackendExchangeFactory *factory)
-{
-}
+static GType exchange_events_type;
+static GType exchange_todos_type;
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -84,51 +83,83 @@ events_backend_exchange_factory_class_init (ECalBackendExchangeFactoryClass *kla
 }
 
 GType
-events_backend_exchange_factory_get_type (void)
+e_cal_backend_exchange_events_factory_get_type (void)
+{
+	return exchange_events_type;
+}
+
+void
+e_cal_backend_exchange_events_factory_register_type (GTypeModule *type_module)
 {
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (ECalBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  events_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (ECalBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_cal_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_CAL_BACKEND_FACTORY,
-					       "ECalBackendExchangeEventsFactory",
-					       &info, 0);
-	}
-	return type;
+	static const GTypeInfo type_info = {
+		sizeof (ECalBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) events_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_events_type = g_type_module_register_type (
+		type_module, E_TYPE_CAL_BACKEND_FACTORY,
+		"ECalBackendExchangeEventsFactory", &type_info, 0);
 }
 
 GType
-todos_backend_exchange_factory_get_type (void)
+e_cal_backend_exchange_todos_factory_get_type (void)
 {
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (ECalBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  todos_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (ECalBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_cal_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_CAL_BACKEND_FACTORY,
-					       "ECalBackendExchangeTodosFactory",
-					       &info, 0);
-	}
-	return type;
+	return exchange_todos_type;
+}
+
+void
+e_cal_backend_exchange_todos_factory_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ECalBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc)  todos_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_todos_type = g_type_module_register_type (
+		type_module, E_TYPE_CAL_BACKEND_FACTORY,
+		"ECalBackendExchangeTodosFactory", &type_info, 0);
+}
+
+void
+eds_module_initialize (GTypeModule *type_module)
+{
+	/* to have a camel type initialized properly */
+	camel_type_init ();
+	camel_object_get_type ();
+
+	e_cal_backend_exchange_events_factory_register_type (type_module);
+	e_cal_backend_exchange_todos_factory_register_type (type_module);
+}
+
+void
+eds_module_shutdown (void)
+{
+}
+
+void
+eds_module_list_types (const GType **types, gint *num_types)
+{
+	static GType module_types[2];
+
+	module_types[0] = e_cal_backend_exchange_events_factory_get_type;
+	module_types[1] = e_cal_backend_exchange_todos_factory_get_type;
+
+	*types = module_types;
+	*num_types = G_N_ELEMENTS (module_types);
 }
diff --git a/calendar/e-cal-backend-exchange.c b/calendar/e-cal-backend-exchange.c
index c803452..e35e630 100644
--- a/calendar/e-cal-backend-exchange.c
+++ b/calendar/e-cal-backend-exchange.c
@@ -51,9 +51,10 @@
 #include <exchange-account.h>
 #include <exchange-hierarchy.h>
 
-#include "exchange-component.h"
 #include <e2k-utils.h>
 
+#include "tools/exchange-share-config-listener.h"
+
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
@@ -375,7 +376,7 @@ open_calendar (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
 			return GNOME_Evolution_Calendar_RepositoryOffline;
 		}
 
-		cbex->account = exchange_component_get_account_for_uri (global_exchange_component, NULL);
+		cbex->account = exchange_share_config_listener_get_account_for_uri (NULL, uristr);
 
 		if (cbex->account) {
 			exchange_account_set_offline (cbex->account);
@@ -408,9 +409,7 @@ open_calendar (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
 	/* Make sure we have an open connection */
 	/* This steals the ExchangeAccount from ExchangeComponent */
 	if (!cbex->account) {
-		cbex->account = exchange_component_get_account_for_uri (global_exchange_component, uristr);
-		if (!cbex->account)
-			cbex->account = exchange_component_get_account_for_uri (global_exchange_component, NULL);
+		cbex->account = exchange_share_config_listener_get_account_for_uri (NULL, uristr);
 	}
 
 	if (!cbex->account) {

