Usually when code needs explanations that long, it's worth putting the explanations in the comments near the code, so that no one tries to refactor it away later without fully understanding why it was done this way in the first place.