adv. search result code clean up