Rewrite blocks with class filters