refactored heirarchy