Played with escaping special characters
Quick refactoring to separate the token scoring logic