Moved populateOrCreate method to TemplateUtility and made static.