Minor refactorings in CertificateManager.