extract same logic into FindNodes method
Merge pull request #423 from mexx/refactorings

extract same logic into FindNodes method