improve transform macro