added resource factory