refactored to use HexEncoder/Decoder fields