Refactoring of dat inheritence mess