Moving template to the right subroutine.