Refactor is_word_separator