Write the whole process to create the template