The threadlocal has the data attribute, you set it at module level.  Why check here that it exists?