Refactor of hierachy