Reduce complexity of chat filtering logic
Simplify togglePref