Refactored to handle punctuation