refactor string tasks