Add documentation for replaceSourceContacts and improve its readability.