rearranged code pieces for utility procedures (hex2int, unescape_component)