refactor examples to use global runtime