learn factory and provider