refactor: refactor method buildNewWord.