minor refactoring -- use `find` and `filter` rather than recursing on lists