Finalized template generation