Switch from static fields to thread-local fields.