optimize with atomic incrementing