Who appeared to Moses and Joshua?

Joshua 5:13-15 NWT

When Joshua was near Jerʹi·cho, he looked up and saw a man standing in front of him with a drawn sword in his hand. Joshua walked up to him and asked: “Are you on our side or on the side of our adversaries?” To this he said: “No, but I have come as prince of Jehovah’s army.” With that Joshua fell with his face to the ground and prostrated himself and said to him: “What does my lord have to say to his servant?” The prince of Jehovah’s army replied to Joshua: “Remove your sandals from your feet, because the place where you are standing is holy.” At once Joshua did so.

Who appeared to Joshua?
Exodus 3:1-6 NWT

Moses became a shepherd of the flock of his father-in-law Jethʹro, the priest of Midʹi·an. While he was leading the flock to the west side of the wilderness, he eventually came to the mountain of the true God, to Horʹeb. Then Jehovah’s angel appeared to him in a flame of fire in the midst of a thornbush. As he kept looking, he saw that the thornbush was on fire, and yet the thornbush was not consumed. So Moses said: “I will go over to inspect this unusual sight to see why the thornbush does not burn up.” When Jehovah saw that he went over to look, God called to him out of the thornbush and said: “Moses! Moses!” to which he said: “Here I am.” Then he said: “Do not come any nearer. Remove your sandals from your feet, because the place where you are standing is holy ground.” He went on to say: “I am the God of your father, the God of Abraham, the God of Isaac, and the God of Jacob.” Then Moses hid his face, because he was afraid to look at the true God.

Who appeared to Moses and spoke to him?
Both the Angel and the Prince command Joshua and Moses to remove their sandals?
Who does the Angel say he is?
Reference: YouTube