simplify hashing technique and move it out of syncronize