extract fmt.print into a separate template file