TLS-related code moved into its own compilation unit