refactor(findByPath): simplified code