added factory class to allow caching
Merge pull request #4 from UaQuetzalcoatl/master

added factory class to allow caching