Factor out row transform method