adding factory hooks