Added Factory instance support. Thanks darrylkuhn