Small refactoring
Make JSONReference class thread-safe