Updating documentation
Refactoring the digest-creation code to remove duplication