Replace synchronized blocks with simple callbacks.