refactoring for better testing of the rename algorithm itself
updated the rename algorithm to replace the explicit character matched instead of replacing the first match in the string