updated several example to use class factories