Creating resource factory.