Refactor to enable checking by hash