Optimize counter creation