The Mashiach Ben Yosef does not appear until all of creation is at the point where it has one more jump left to total purity, because he is the climax of that process and he brings the end. Since Adam's sin, the snake exuded a foulness which constituted his transformation into a different agent who's at war with man, whose sole goal is to destroy man. His power entered into the very nature of man and by doing this he is able to manipulate a person in such a way as to cut off certain elements of his free will. That foulness invades the Mashiach Ben Yosef as well. It is a cloned copy of the invasion of the foulness into Adam himself. In order for redemption to occur, all men must be restored to the level of Adam before the sin. It means the foulness must be removed not only from creation, but also from the inner nature of man and restoring all men to having 100 percent free will. Mashiach will remove the foulness first from himself and then from everyone else. The Mashiach will be the first man to resemble Adam since his time. By freeing himself, he will understand how to free all of mankind at the same time. Just as the nation of Israel and the Mashiach are in the klipa, the Torah is also in the klipa so that Israel does not merit to attain the light of truth of Torah or to attain His oneness. When the foulness is cleansed from the Mashiach Ben Yosef, the Shechina is lifted out, and it leaves the light of exile.