Refactor extraction of certificate details.