Move template definition out of function.
Template adjustments.