Simplifiy code. Add digest method.