Adapt code such that onotolgies are taken into account