refactor to correctly work with solr