Global variables refactored for proper concurrency