rearrange all ontology related code (2)