extract synchronization code