refactored basic string class