add Unit type support to Codec