Replace synchronized usage with ConcurrentMap and AtomicInteger

Motivation:
The code before used a synchronized block which can be removed in favor for using ConcurrentMap and AtomicInteger

Modifications:
* Replace synchronized block with ConcurrentMap + AtomicInteger

Result:
Less overhead