nice. maybe move `search_name_pattern` outside the logic, and specify it once?