Update template metadata & state