moved type converter logic to transformer