agg optimization and sharded collection changes