Improves structure of Search class

Fewer pointless DB queries :-)