Refactored String class