working with factories