little refactoring and real shard config