optimised word filter