Refactor the ReverseWords.