use Thread.current instead of class variables
use add_runtime_dependency instead of add_dependency