added factory class to allow caching