wordsHandler refactored