Refactor RDF service