nitpick, `(ds.uncommitted ? ds.uncommitted : 0)` could be written as `ds.uncommitted || 0`