Changed low level implementation for better handling of string/bytes