Computational protein design has promise for vaccine design and other applications. We previously transplanted the HIV 4E10 epitope onto non-HIV protein scaffolds for structural stabilization and immune presentation. Here, we developed two methods to optimize the structure of an antigen, flexible backbone remodeling and resurfacing, and we applied these methods to a 4E10 scaffold. In flexible-backbone remodeling, an existing backbone segment is replaced by a de novo designed segment of prespecified length and secondary structure. With remodeling, we replaced a potentially immunodominant domain on the scaffold with a helix-loop segment that made intimate contact to the protein core. All three domain trim designs tested experimentally had improved thermal stability and similar binding affinity for the 4E10 antibody compared to the parent scaffold. A crystal structure of one design had a 0.8 angstrom backbone RMSD to the computational model in the rebuilt region. Comparison of parent and trimmed scaffold reactivity to anti-parent sera confirmed the deletion of an immunodominant domain. In resurfacing, the surface of an antigen outside a target epitope is redesigned to obtain variants that maintain only the target epitope. Resurfaced variants of two scaffolds were designed in which 50 positions amounting to 40% of the protein sequences were mutated. Surface-patch analyses indicated that most potential antibody footprints outside the 4E10 epitope were altered. The resurfaced variants maintained thermal stability and binding affinity. These results indicate that flexible-backbone remodeling and resurfacing are useful tools for antigen optimization and protein engineering generally.