Update example code based on new factory pattern.
Merge pull request #5 from therealdpk/master

Update example code based on new factory pattern.