add test on factory