internal template creation