faster matching of potential next nodes
DRY up matchings