What were the Spanish wars directly linked to?