rebuild code struct