Added count caching to batch operations to speed it up by 40%