Refactored the TLS use of the new runtime