Refactor byteorder converter.