Flatten some control flow to prepare for rearranging.