Combine search into a single method; reduces code duplication.