some cleanups, add option to specify hash algorithm to getFingerprint method