String class refactoring