Setting up datatypes to handle Clafer hierarchy. Refactoring