Thread-safe implementation has been simplified