Store hashes instead of recomputing