Added constructor variants which takes a transformation.