Cleaning up search result code a bit.