more refactoring
handle bad input: key string missing double quotes
refactoring: inlined functions, extract special chars to dedicated object