Refactored type to use EMs, fixed hierarchy issues