completed template transformation