small refactor for sha1