Switched to an atomic reference for efficiency