Change bidir refine hash code so we only need to perform a single