change to use factory again