moved some parts of the search linq query from the VM into the repo.