refactor

modification to the substring…