refactor for processing articles instead of words