Simplify implementation of category filter