why is this helper defined inside `_block_matches`, and not at the class level?