refactor unknown word handling