             loginCsrfParam: entries.csrfToken
             submit: "Sign+in"
 
+    log.info 'Signing in...'
     request.post opts, (err, res, body) ->
         return next err if err
 
         if body is ""
-            log.info 'Login success'
+            log.info 'Login succeeded!'
             next()
         else
-            log.error 'Bad login / password'
-            next new Error("Bad login/Password")
-
-
-# Retrieve a list of all contacts id available in the count. The id will be
-# use to retrieve his personnal data.
-retrieveListContact = (requiredFields, entries, data, next) ->
+            log.error 'Wrong login or password.'
+            next new Error("Wrong login or password.")
+
+
+# Retrieve a list of all Linkedin ID contacts available. The linkedin ID will
+# be used to retrieve additional data about the contact.
+retrieveContactList = (requiredFields, entries, data, next) ->
     log.info 'Retrieve list contact'
 
-    contacts = "https://www.linkedin.com/contacts/api/contacts/?start=0&count=10000&fields=id"
+    contactsUrl = "https://www.linkedin.com/contacts/api/contacts/"
+    contactsUrl += "?start=0&count=10000&fields=id"
     opts =
-        url: contacts
+        url: contactsUrl
         jar: true
         json: true
 
+    log.info 'Retrieve contact list...'
     request.get opts, (err, res, body) ->
         return next err if err
+
         if body.status? and body.status is 'error'
-            return next new Error(body.status_details)
-
-        entries.listContacts = body.contacts
-        if not entries.listContacts?
-            next new Error("Error retrieving contacts from request")
+            next new Error body.status_details
         else
-            log.info 'List contact OK'
-            next()
-
-
-# Retrieve a list of all Cozy contacts, find all the contacts linked to the
-# current Linkedin account an put them in a list by id
+            entries.listContacts = body.contacts
+            if not entries.listContacts?
+                next new Error "Error retrieving contacts from request"
+            else
+                log.info 'Contact list retrieved.'
+                next()
+
+
+# Load all Cozy contacts, then perform several operations:
+#
+# * Keep only contacts linked to the current LinkedinAccount
+# * Order them in a map where the LinkedIn account ID is the key
+# * Order them in a map where the contact full name is the key.
+#
+# That way we will be able to check if the contact should be updated (because
+# it already exists) or if it should be created.
+#
 prepareCozyContacts = (requiredFields, entries, data, next) ->
-    log.info 'Prepare Cozy contacts'
-
+
+    log.info 'Load Cozy contacts...'
     Contact.all (err, contacts) ->
         return next err if err
 

    listUrls


# Currently there isn't an address parser so all the address is set in the
# locality fields. The Linkedin API allow us to define some fields precisely but
# that can lead to a duplicat so only the country is specify in the right fields
# and we should wait an address parser before use them
getAddresses = (data) ->
    listAddresses = []

            name: 'url'
            value: site.url
            type: site.name

    data.profiles?.forEach (profile) ->
        listUrls.push
            name: 'url'
            value: profile.url
            type: 'linkedin'

    data.twitter?.forEach (twitter) ->
        listUrls.push
            name: 'url'
