- removed assumption that ShardId attribute is always present (when there's no data in the table for example)
- added more unit testst