Refactor to make TemplateCatalog immutable