Refactored type conversions