refactored hierarchy