Refactor HashContext into an object.