better filtering/cleaning for term counting