Make filters more DRY

Remove the three separate classes all doing the exact same thing, added a class filter instead.