now just finding one thread that works for a given template rather than generating the tree of every one and plucking it