refactored type and string support