refactored model search method