Revert "generic helpers for directory list and search"

This reverts commit 04770fdb875fb3a1bcd92c43aa58671fcb399ee0.