Overhaul of anonymous structure matching