replace filter_block with std::unique_ptr to support RAII