sparql queries and other proxy code refactoring