update benchmark and examples to new programming style