refactored type manager