added Function interface and generic transform method