Extract out factory