Simplify searchBaseDir reduce logic