introduce pendingUpdates, and more code documents