updating examples to use class factories