Refactoring insert functions of string_t.