Refactor stringRange