refactor to use Undo.AddComponent