Replace ThreadLocals by variables.