diff --git a/bin/account-manager-client.pl b/bin/account-manager-client.pl
index 3e7127115902a7eeba8e88b636a6dedd4c260f96..c1dccd6970b3ec92a6318be133a9d2b35d8ac8d0 100755
--- a/bin/account-manager-client.pl
+++ b/bin/account-manager-client.pl
@@ -6,15 +6,17 @@
 use strict;
 use utf8;
 use lib "/opt/testidp/IdPAccountManager/lib";
+use lib "/opt/testidp/IdPAccountManager/conf";
 
 use Getopt::Long;
 use POSIX;
 
 use IdPAccountManager::TestAccount;
 use IdPAccountManager::SAMLMetadata;
+use IdPAccountManager::ServiceProvider;
 
 my %options;
-unless (&GetOptions(\%options, 'help', 'create_test_account', 'account_profile=s', 'sp_entityid=s', 'list_test_accounts', 'parse_federation_metadata')) {
+unless (&GetOptions(\%options, 'help', 'create_test_account', 'account_profile=s', 'sp_entityid=s', 'list_test_accounts', 'parse_federation_metadata', 'list_service_providers')) {
     die "Unknown options.";
 }
 
@@ -65,7 +67,7 @@ if ($options{'create_test_account'}) {
     }
 }elsif ($options{'parse_federation_metadata'}) {
     my $federation_metadata = new IdPAccountManager::SAMLMetadata;
-    unless ($federation_metadata->load(federation_metadata_file_path => $IdPAccountManager::Conf::global{'federation_metadata_file_path'})) {
+    unless ($federation_metadata->load(federation_metadata_file_path => $Conf::global{'federation_metadata_file_path'})) {
         die;
     }
     
@@ -78,12 +80,21 @@ if ($options{'create_test_account'}) {
         die;
     }
     
-    printf "Document %s parsed\n", $IdPAccountManager::Conf::global{'federation_metadata_file_path'};
+    printf "Document %s parsed\n", $Conf::global{'federation_metadata_file_path'};
     
     ## List SAML entities
     printf "Hashref representing the metadata:\n";
     &IdPAccountManager::Tools::dump_var($federation_metadata->{'federation_metadata_as_hashref'}, 0, \*STDOUT);
     
+}elsif ($options{'list_service_providers'}) {
+    
+    my %args;    
+    
+    my $all = IdPAccountManager::ServiceProvider::list_service_providers(%args);
+    
+    foreach my $service_provider (@$all) {
+        $service_provider->print();
+    }
      
 }else {
     die "Missing arguments";
diff --git a/bin/account-manager-web.pl b/bin/account-manager-web.pl
index 6415ecd95708cb2bb9e14fdc7c7b6d5802fe94f9..5707ee989e3ecf13b2872f986b59cb2a01cd83f8 100755
--- a/bin/account-manager-web.pl
+++ b/bin/account-manager-web.pl
@@ -6,6 +6,7 @@
 use strict vars;
 use utf8;
 use lib "/opt/testidp/IdPAccountManager/lib";
+use lib "/opt/testidp/IdPAccountManager/conf";
 
 use CGI;
 use CGI::Cookie;
@@ -35,7 +36,7 @@ my %actions = ('select_sp' => {'title_en' => 'Select your Service Provider'    }
 ## Gives writes for the group
 umask 0002;
 
-chdir $IdPAccountManager::Conf::global{'root_manager_dir'};
+chdir $Conf::global{'root_manager_dir'};
 
 my $request = new WebRequest;
 
@@ -71,7 +72,7 @@ sub new {
   $request->{'param_out'}{'url_cgi'} = $ENV{'SCRIPT_NAME'};
   $request->{'param_out'}{'env'} = \%ENV;
   $request->{'param_out'}{'actions'} = \%actions;
-  $request->{'param_out'}{'conf'} = \%IdPAccountManager::Conf::global;
+  $request->{'param_out'}{'conf'} = \%Conf::global;
 
   ## Dumping input data
   #open TMP, ">/tmp/account_manager.in"; &IdPAccountManager::Tools::dump_var($request->{'param_in'}, 0, \*TMP); close TMP;
@@ -228,7 +229,7 @@ sub req_get_sp_list {
     &IdPAccountManager::Tools::do_log('info', "");
 
     my $federation_metadata = new IdPAccountManager::SAMLMetadata;
-    unless ($federation_metadata->load(federation_metadata_file_path => $IdPAccountManager::Conf::global{'federation_metadata_file_path'})) {
+    unless ($federation_metadata->load(federation_metadata_file_path => $Conf::global{'federation_metadata_file_path'})) {
 	      push @{$self->{'param_out'}{'errors'}}, "internal";
 	      &IdPAccountManager::Tools::do_log('error', "Failed to load federation metadata : $!");
 	      return undef;
@@ -258,7 +259,7 @@ sub req_select_sp {
     }
     
     my $federation_metadata = new IdPAccountManager::SAMLMetadata;
-    unless ($federation_metadata->load(federation_metadata_file_path => $IdPAccountManager::Conf::global{'federation_metadata_file_path'})) {
+    unless ($federation_metadata->load(federation_metadata_file_path => $Conf::global{'federation_metadata_file_path'})) {
 	push @{$self->{'param_out'}{'errors'}}, "internal";
 	&IdPAccountManager::Tools::do_log('error', "Failed to load federation metadata : $!");
 	return undef;
diff --git a/bin/create-database.pl b/bin/create-database.pl
index c464be906f6c1160e7ce7a8355c03f38f031bb12..a154a5985ec8623038ac010aa99d04faecd76a3c 100755
--- a/bin/create-database.pl
+++ b/bin/create-database.pl
@@ -2,24 +2,25 @@
 ## Initialize Rose::DB code given the DB structure
 
 use lib "/opt/testidp/IdPAccountManager/lib";
+use lib "/opt/testidp/IdPAccountManager/conf";
 
 use Rose::DB;
 use Rose::DB::Object::Loader;
 use Getopt::Long;
-use IdPAccountManager::Conf;
+use Conf;
 
 my %options;
 unless (&GetOptions(\%options, 'database=s')) {
     die "Unknown options.";
 }
 
-my $dbname = $options{'database'} || $IdPAccountManager::Conf::global{'database_name'};
+my $dbname = $options{'database'} || $Conf::global{'database_name'};
 
 $loader = 
     Rose::DB::Object::Loader->new(
-        db_dsn       => 'dbi:'.$IdPAccountManager::Conf::global{'database_type'}.':dbname='.$dbname.';host='.$IdPAccountManager::Conf::global{'database_host'},
-        db_username  => $IdPAccountManager::Conf::global{'database_user'},
-        db_password  => $IdPAccountManager::Conf::global{'database_password'},
+        db_dsn       => 'dbi:'.$Conf::global{'database_type'}.':dbname='.$dbname.';host='.$Conf::global{'database_host'},
+        db_username  => $Conf::global{'database_user'},
+        db_password  => $Conf::global{'database_password'},
         db_options   => { AutoCommit => 1, ChopBlanks => 1 },
         class_prefix => 'IdPAccountManager::Data',
         #with_unique_keys => 0,
diff --git a/bin/expire-test-accounts.pl b/bin/expire-test-accounts.pl
index 070f7c702bcc931950731aa183983f3d7ed2dcd6..cba95192a37380d26da2b6c47a456e6b19ad9707 100755
--- a/bin/expire-test-accounts.pl
+++ b/bin/expire-test-accounts.pl
@@ -7,6 +7,7 @@
 use strict;
 use utf8;
 use lib "/opt/testidp/IdPAccountManager/lib";
+use lib "/opt/testidp/IdPAccountManager/conf";
 
 use Getopt::Long;
 use POSIX;
@@ -40,7 +41,7 @@ if ($options {'list_only'}) {
     }
     printf "%d accounts removed\n", $#{$all}+1;
 
-    #&IdPAccountManager::Tools::dump_var(\%IdPAccountManager::Conf::global, 0, \*STDOUT);
+    #&IdPAccountManager::Tools::dump_var(\%Conf::global, 0, \*STDOUT);
 
     ## Update simpleSamlPhp configuration file
     printf "Update simpleSamlPhp configuration file...\n";
diff --git a/lib/IdPAccountManager/SAMLMetadata.pm b/lib/IdPAccountManager/SAMLMetadata.pm
index 85e346765fbdc52b95e3e8e6c0bcf651f27f871b..37a705e6671ec94819eeebdea6cebeea5ce2086f 100644
--- a/lib/IdPAccountManager/SAMLMetadata.pm
+++ b/lib/IdPAccountManager/SAMLMetadata.pm
@@ -3,7 +3,7 @@ package IdPAccountManager::SAMLMetadata;
 use strict;
 
 use IdPAccountManager::Tools;
-use IdPAccountManager::Conf;
+use Conf;
 
 use XML::LibXML;
 
diff --git a/lib/IdPAccountManager/TestAccount.pm b/lib/IdPAccountManager/TestAccount.pm
index b7d43b370e9f6d82c8c6eb3601a13736a3295158..22cf234324979d3ad66b62b512a57b6f3eb6c493 100644
--- a/lib/IdPAccountManager/TestAccount.pm
+++ b/lib/IdPAccountManager/TestAccount.pm
@@ -6,7 +6,7 @@ use IdPAccountManager::Data::Testaccount;
 use IdPAccountManager::Data::Testaccount::Manager;
 
 use IdPAccountManager::Tools;
-use IdPAccountManager::Conf;
+use Conf;
 
 require Exporter;
 my @ISA = qw(Exporter);
@@ -58,7 +58,7 @@ sub save {
     ## If no id is defined, it is a new account
     unless (defined $self->{'persistent'}->id) {
         $self->{'persistent'}->creation_date(time);
-        $self->{'persistent'}->expiration_date(time + ($IdPAccountManager::Conf::global{'accounts_validity_period'} * 3600 * 24));
+        $self->{'persistent'}->expiration_date(time + ($Conf::global{'accounts_validity_period'} * 3600 * 24));
         $self->{'user_password'} = &IdPAccountManager::Tools::generate_password();
         $self->{'persistent'}->user_password_hash(&IdPAccountManager::Tools::sha256_hash($self->{'user_password'}));
     }
diff --git a/lib/IdPAccountManager/Tools.pm b/lib/IdPAccountManager/Tools.pm
index 445134606ef85ec24365dec40411d60bb575c2a4..e0df349626c6ab14f28a7d5dc15da6f5c7894ff7 100644
--- a/lib/IdPAccountManager/Tools.pm
+++ b/lib/IdPAccountManager/Tools.pm
@@ -56,11 +56,11 @@ sub generate_password{
 ## Updates simpleSamlPhp authsources.php configuration file
 sub update_ssp_authsources {
     
-    my $tt2 = Template->new({'INCLUDE_PATH' => $IdPAccountManager::Conf::global{'root_manager_dir'}.':'.$IdPAccountManager::Conf::global{'root_manager_dir'}.'/templates/accountProfiles'});
+    my $tt2 = Template->new({'INCLUDE_PATH' => $Conf::global{'root_manager_dir'}.':'.$Conf::global{'root_manager_dir'}.'/templates/accountProfiles'});
     my %args = ('accounts' => IdPAccountManager::TestAccount::list_test_accounts(),
-                'conf' => \%IdPAccountManager::Conf::global);
+                'conf' => \%Conf::global);
     
-    #chdir $IdPAccountManager::Conf::global{'root_manager_dir'};
+    #chdir $Conf::global{'root_manager_dir'};
     
     my $template_file = 'templates/accountProfiles/valid-accounts.php.tt2';
     my $output_file = 'conf/valid-accounts.php';
@@ -107,7 +107,7 @@ sub do_log {
     my $level = shift;
     my $message = shift;
 
-    unless ($log_levels{$level} < $log_levels{$IdPAccountManager::Conf::global{'log_level'}}) {
+    unless ($log_levels{$level} < $log_levels{$Conf::global{'log_level'}}) {
 
         ## Determine calling function and parameters
         ## If in 'err' level, build a stack trace
@@ -131,7 +131,7 @@ sub do_log {
         my $ip = $ENV{'REMOTE_HOST'}.'/'.$ENV{'REMOTE_ADDR'} || 'NOIP';
         my $date = POSIX::strftime ("%Y:%m:%d %H:%M:%S", localtime(time));
         my $user = lc($ENV{'mail'}) || 'NOEMAIL';
-        open LOG, ">>".$IdPAccountManager::Conf::global{'log_file'}; printf LOG "$date - ($level) - $ip - $user - $caller_string $message\n", @_; close LOG;       
+        open LOG, ">>".$Conf::global{'log_file'}; printf LOG "$date - ($level) - $ip - $user - $caller_string $message\n", @_; close LOG;       
     }
     return 1;
 }
@@ -147,14 +147,14 @@ sub mail_notice {
   my $tt2_file = $in{'template'};
   my $mail_data = $in{'data'};
 
-  $mail_data->{'conf'} ||= \%IdPAccountManager::Conf::global;
+  $mail_data->{'conf'} ||= \%Conf::global;
 
-  my $notice_email = $in{'to'} || $IdPAccountManager::Conf::global{'admin_email'};
+  my $notice_email = $in{'to'} || $Conf::global{'admin_email'};
   $mail_data->{'to'} = $notice_email;
   
   ## Protection to prevent notifications during test dev phases
   ## Notify only adresses @renater.fr
-  if ($IdPAccountManager::Conf::global{'no_mail_outside'}) {
+  if ($Conf::global{'no_mail_outside'}) {
 	foreach my $email (split /,/, $notice_email) {
 		unless ($email =~ /\@(cru|renater)\.fr$/) {
 			&do_log('error',"Notification to an external address skipped");
@@ -165,7 +165,7 @@ sub mail_notice {
 
   &do_log('trace', '(template=%s, to=%s)', $in{'template'}, $mail_data->{'to'});
 
-  open SENDMAIL, "|/usr/sbin/sendmail -f ".$IdPAccountManager::Conf::global{'notice_from'}." $notice_email";
+  open SENDMAIL, "|/usr/sbin/sendmail -f ".$Conf::global{'notice_from'}." $notice_email";
 
   my $tt2 = Template->new(FILTERS => {qencode => [\&qencode, 0]});
   unless ($tt2->process($tt2_file, $mail_data, \*SENDMAIL)) {