remove some goto codes