further refactoring to shard split logic