refactoring
implemented sharded count queries