Refactoring and more solr stuff