Refactor and add hashmeter