complete factory_method