Simplify the search paths code