Add unknownDigest part, code cleanup