not to duplicate the string when adding assoc string
re-use doc_var_val_len
simplify doc_var statements