Factoring out data retrieval

Preparing for multiple search index/types