cleaned up search view code