Major refactoring to the way synchronization is implemented.