Refactoring of the way hex are emitted