Functional refactoring of OntologyProvider