This should improve performance significantly as it avoids many unnecessary sync transactions. It also makes the code more readable.