refactor string