issue #3: prevent thread-safety issues in initializer code by scoping variable names to thread