`closest` should return as soon as a match is found, so I don't think calling `parents` and culling the result set is the right approach. I agree with @zero21xxx, though, that these similar methods should share code. Perhaps we should have a private function with `parents` and `closest` both call, with a switch for early termination.