fix how we iterate over branches and components