Added routine and template file copying