concurrency would probably be useful as an argument to pass in, rather than relying on a global.