Performance fixes in each iteration