Refactor member search functionality to check last names against query