optimize code struct