Add partcodeFromTemplate method