Worked on replacing regex with string methods