Cleaned up search method