He's done a lot with partially destroyed things before. After Festus got destroyed, he had to rebuild the entire body. Still not sure how he did it without use realizing fully what he was doing while being on the boat with him. But the entire Hephaestus cabin are pretty smart about building things in general.