Refactoring basic_string private functions.