More refactoring. Better digest parsing.