More intelligent synchronization code.