test for factory